lpd: fix OOM vulnerability (was eating arbitrarily large commands)

This commit is contained in:
Denis Vlasenko
2008-03-24 00:04:42 +00:00
parent a79428998d
commit 0b6c6a9c9f
4 changed files with 33 additions and 19 deletions

View File

@@ -1061,7 +1061,7 @@ static int builtin_read(char **argv)
char *string;
const char *name = argv[1] ? argv[1] : "REPLY";
string = xmalloc_reads(STDIN_FILENO, xasprintf("%s=", name));
string = xmalloc_reads(STDIN_FILENO, xasprintf("%s=", name), NULL);
return set_local_var(string, 0);
}