diff options
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 8 | ||||
-rw-r--r-- | sbin/dhclient/options.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 5e353bc64ba..c38128fce1a 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.111 2007/02/25 18:10:43 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.112 2007/06/02 01:29:11 pvalchev Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -2088,9 +2088,11 @@ option_as_string(unsigned int code, unsigned char *data, int len) for (; dp < data + len; dp++) { if (!isascii(*dp) || !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { + size_t oplen; snprintf(op, opleft, "\\%03o", *dp); - op += 4; - opleft -= 4; + oplen = strlen(op); + op += oplen; + opleft -= oplen; } } else if (*dp == '"' || *dp == '\'' || *dp == '$' || *dp == '`' || *dp == '\\') { diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index 2e3372babf2..890747d3c38 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.35 2007/05/31 23:24:15 pvalchev Exp $ */ +/* $OpenBSD: options.c,v 1.36 2007/06/02 01:29:11 pvalchev Exp $ */ /* DHCP options parsing and reassembly. */ @@ -297,10 +297,12 @@ pretty_print_option(unsigned int code, unsigned char *data, int len, !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { + size_t oplen; snprintf(op, opleft, "\\%03o", *dp); - op += 4; - opleft -= 4; + oplen = strlen(op); + op += oplen; + opleft -= oplen; } } else if (*dp == '"' || *dp == '\'' || |