blob: 4f89530f43e76f95fde877a146d935969e44e100 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Taken from Fedora
--- misc.c
+++ misc.c
@@ -135,11 +135,17 @@
char *fullpath (direntry)
struct direntry *direntry;
{
- static char result[PATHSIZE];
+ static char result[PATHSIZE+LFNAMESIZE+12]; /* Room for enough space.*/
combine (result,
direntry->dirlen != 0 ? direntry->dirname : "",
(direntry->namlen != 0) ? direntry->lfname : direntry->fname
);
+
+ if (strlen (result) >= PATHSIZE) {
+ prterror ('f', "Combined dirname and filename too long!\n");
+ *result = '\0';
+ }
+
return (result);
}
|