Displaying 2 results from an estimated 2 matches for "enddir".
2019 Jan 25
0
[klibc:update-dash] expand: Fix buffer overflow in expandmeta
...(i < 2048 ? 2048 : i); /* XXX */
- }
+ len = strlen(p);
+ expdir_max = len + PATH_MAX;
+ expdir = ckmalloc(expdir_max);
- expmeta(expdir, p);
+ expmeta(p, len, 0);
ckfree(expdir);
if (p != str->text)
ckfree(p);
@@ -1304,8 +1305,9 @@ nometa:
*/
STATIC void
-expmeta(char *enddir, char *name)
+expmeta(char *name, unsigned name_len, unsigned expdir_len)
{
+ char *enddir = expdir + expdir_len;
char *p;
const char *cp;
char *start;
@@ -1348,15 +1350,15 @@ expmeta(char *enddir, char *name)
}
}
if (metaflag == 0) { /* we've reached the end of the file name */
-...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix buffer overflow in expandmeta
...(i < 2048 ? 2048 : i); /* XXX */
- }
+ len = strlen(p);
+ expdir_max = len + PATH_MAX;
+ expdir = ckmalloc(expdir_max);
- expmeta(expdir, p);
+ expmeta(p, len, 0);
ckfree(expdir);
if (p != str->text)
ckfree(p);
@@ -1304,8 +1305,9 @@ nometa:
*/
STATIC void
-expmeta(char *enddir, char *name)
+expmeta(char *name, unsigned name_len, unsigned expdir_len)
{
+ char *enddir = expdir + expdir_len;
char *p;
const char *cp;
char *start;
@@ -1348,15 +1350,15 @@ expmeta(char *enddir, char *name)
}
}
if (metaflag == 0) { /* we've reached the end of the file name */
-...