diff options
author | krw <krw@openbsd.org> | 2020-05-13 20:14:39 +0000 |
---|---|---|
committer | krw <krw@openbsd.org> | 2020-05-13 20:14:39 +0000 |
commit | 1c1c097e4d85f61865d20f8297ca7bee67381750 (patch) | |
tree | 4302103f9558f60296cb71c0d9c7d2b0d4357c1b /sbin | |
parent | No need to memcpy() into a string created by strdup(). (diff) | |
download | wireguard-openbsd-1c1c097e4d85f61865d20f8297ca7bee67381750.tar.xz wireguard-openbsd-1c1c097e4d85f61865d20f8297ca7bee67381750.zip |
Nuke a variable that is always set to 0.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/clparse.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 7f06b862ff8..f5ba035f8e5 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.196 2020/05/13 19:48:10 krw Exp $ */ +/* $OpenBSD: clparse.c,v 1.197 2020/05/13 20:14:39 krw Exp $ */ /* Parser for dhclient config and lease files. */ @@ -785,7 +785,6 @@ parse_option(FILE *cfile, int *code, struct option_data *options) long long number; unsigned int hunkix = 0; int i, freedp, len, token; - int nul_term = 0; token = next_token(&val, cfile); i = name_to_code(val); @@ -913,10 +912,10 @@ parse_option(FILE *cfile, int *code, struct option_data *options) } while (*fmt == 'A' && token == ','); free(options[i].data); - options[i].data = malloc(hunkix + nul_term); + options[i].data = malloc(hunkix); if (options[i].data == NULL) fatal("option data"); - memcpy(options[i].data, hunkbuf, hunkix + nul_term); + memcpy(options[i].data, hunkbuf, hunkix); options[i].len = hunkix; *code = i; |