]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
handle underflow now that n is unsigned
authorMark Andrews <marka@isc.org>
Mon, 9 Dec 2013 20:16:19 +0000 (07:16 +1100)
committerMark Andrews <marka@isc.org>
Mon, 9 Dec 2013 20:16:19 +0000 (07:16 +1100)
lib/dns/spnego.c

index 59b3cbe4bf7edc6c47489a01cc4fb54623284eb7..b6c9e2a3e062e12a9f4aa0177115185433a162e5 100644 (file)
@@ -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);