diff options
author | 2007-05-31 23:24:15 +0000 | |
---|---|---|
committer | 2007-05-31 23:24:15 +0000 | |
commit | 975511d97168abb29d5054faf5cab51a3ff7251e (patch) | |
tree | c74607c95017435bdd9917c999eba0074d575c18 | |
parent | Add Bluetooth drivers to GENERIC (not enabled - we still have ways to go) (diff) | |
download | wireguard-openbsd-975511d97168abb29d5054faf5cab51a3ff7251e.tar.xz wireguard-openbsd-975511d97168abb29d5054faf5cab51a3ff7251e.zip |
fix a funny memory miscalculation bug in options parsing
ok henning otto theo
-rw-r--r-- | sbin/dhclient/options.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index 03480881f3b..2e3372babf2 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.34 2007/02/14 23:19:26 deraadt Exp $ */ +/* $OpenBSD: options.c,v 1.35 2007/05/31 23:24:15 pvalchev Exp $ */ /* DHCP options parsing and reassembly. */ @@ -285,6 +285,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, for (i = 0; i < numhunk; i++) { for (j = 0; j < numelem; j++) { int opcount; + size_t oplen; switch (fmtbuf[j]) { case 't': if (emit_quotes) { @@ -390,8 +391,9 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, default: warning("Unexpected format code %c", fmtbuf[j]); } - op += strlen(op); - opleft -= strlen(op); + oplen = strlen(op); + op += oplen; + opleft -= oplen; if (opleft < 1) goto toobig; if (j + 1 < numelem && comma != ':') { |