Fix nid assignment in ASN1_STRING_TABLE_add
authorlolyonok <archylog@gmail.com>
Fri, 14 Jul 2017 15:22:12 +0000 (18:22 +0300)
committerRich Salz <rsalz@openssl.org>
Mon, 24 Jul 2017 18:52:43 +0000 (14:52 -0400)
CLA: trivial

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3934)

(cherry picked from commit 386e9169c35718436ba038dff93711d2db73fa6a)

crypto/asn1/a_strnid.c

index aadc26ced03d10b63c710eb9f9f3142e2a1e2449..ecf178e28bae7c9045c8a59668bf505440119229 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -214,6 +214,7 @@ static ASN1_STRING_TABLE *stable_get(int nid)
         rv->mask = tmp->mask;
         rv->flags = tmp->flags | STABLE_FLAGS_MALLOC;
     } else {
+        rv->nid = nid;
         rv->minsize = -1;
         rv->maxsize = -1;
         rv->flags = STABLE_FLAGS_MALLOC;