From: Mark Andrews Date: Mon, 9 Dec 2013 20:16:19 +0000 (+1100) Subject: handle underflow now that n is unsigned X-Git-Tag: v9.8.7b1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=536ac5312652ff17412f36d1194c9a0948df7d37;p=thirdparty%2Fbind9.git handle underflow now that n is unsigned --- diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c index 59b3cbe4bf7..b6c9e2a3e06 100644 --- a/lib/dns/spnego.c +++ b/lib/dns/spnego.c @@ -1229,8 +1229,8 @@ der_put_oid(unsigned char *p, size_t len, unsigned char *base = p; size_t n; - for (n = data->length - 1; n >= 2u; --n) { - unsigned u = data->components[n]; + for (n = data->length; n >= 3u; --n) { + unsigned u = data->components[n - 1]; if (len < 1U) return (ASN1_OVERFLOW);