Merge from the 5.3 branch (security fix). Tagged as merge_53_src, merge_53_dst, merge...
[mod_auth_kerb.git] / spnegokrb5 / der_get.c
index a8fbafe..50453d4 100644 (file)
@@ -151,7 +151,7 @@ der_get_oid (const unsigned char *p, size_t len,
     if (len < 1)
        return ASN1_OVERRUN;
 
-    data->components = malloc(len * sizeof(*data->components));
+    data->components = malloc((len + 1) * sizeof(*data->components));
     if (data->components == NULL && len != 0)
        return ENOMEM;
     data->components[0] = (*p) / 40;