Fix off-by-one found by valgrind.
authorVolker Lendecke <vlendec@samba.org>
Thu, 31 Jul 2003 15:53:59 +0000 (15:53 +0000)
committerVolker Lendecke <vlendec@samba.org>
Thu, 31 Jul 2003 15:53:59 +0000 (15:53 +0000)
Volker

source/libsmb/spnego.c

index 267e2f24ffdd59f9bf71187fcb6c8d79a467d422..8cf2413a2150281e0625280af6eaf4d575abfe98 100644 (file)
@@ -46,7 +46,7 @@ static BOOL read_negTokenInit(ASN1_DATA *asn1, negTokenInit_t *token)
                        for (i = 0; !asn1->has_error &&
                                     0 < asn1_tag_remaining(asn1); i++) {
                                token->mechTypes = 
-                                       realloc(token->mechTypes, (i + 1) *
+                                       realloc(token->mechTypes, (i + 2) *
                                                sizeof(*token->mechTypes));
                                asn1_read_OID(asn1, token->mechTypes + i);
                        }