mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
lib: Initialize getline() arguments
Keep "len" valid across the loop iterations for getline to consume Bug: https://bugzilla.samba.org/show_bug.cgi?id=13892 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
b1582a4d09
commit
c0b2272a7d
@ -30,6 +30,7 @@ int parse_resolvconf_fp(
|
||||
size_t *pnum_nameservers)
|
||||
{
|
||||
char *line = NULL;
|
||||
size_t len = 0;
|
||||
char **nameservers = NULL;
|
||||
size_t num_nameservers = 0;
|
||||
int ret = 0;
|
||||
@ -38,7 +39,6 @@ int parse_resolvconf_fp(
|
||||
char *saveptr, *option, *ns;
|
||||
char **tmp;
|
||||
ssize_t n;
|
||||
size_t len;
|
||||
|
||||
n = getline(&line, &len, fp);
|
||||
if (n < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user