mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
And another buffer overflow. Maybe next time I should read the manpage for
strlen. This one only occurs if there is exactly one element on the line without any whitespace. This is however never a valid line, so not a big chance that this would ever cause any problems.
This commit is contained in:
parent
f20f83ab5f
commit
7f2b4ad54a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63273
@ -241,7 +241,7 @@ get_string(char *src, char **rdst, char **rsrc)
|
||||
int j; /* index into dst */
|
||||
int quoted = 0; /* 1 for single, 2 for double quoted */
|
||||
|
||||
dst = malloc(strlen(src)); /* XXX allocation is too big, realloc?*/
|
||||
dst = malloc(strlen(src)+1); /* XXX allocation is too big, realloc?*/
|
||||
if (dst == NULL) { /* should not happen, really */
|
||||
fprintf(stderr, "%s:%d: Out of memory\n", configfile, lineno);
|
||||
exit(2);
|
||||
|
Loading…
Reference in New Issue
Block a user