]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
remove magic number
authorFdaSilvaYY <fdasilvayy@gmail.com>
Mon, 6 Nov 2017 17:32:33 +0000 (18:32 +0100)
committerRich Salz <rsalz@openssl.org>
Mon, 13 Nov 2017 12:52:35 +0000 (07:52 -0500)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4719)

crypto/x509v3/v3_alt.c

index 520235c94e65c4e45c49069a7137ff7846ca2d17..832e6d1285712ee9ad481492657761f64c0bdc36 100644 (file)
@@ -68,6 +68,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
     unsigned char *p;
     char oline[256], htmp[5];
     int i;
+
     switch (gen->type) {
     case GEN_OTHERNAME:
         if (!X509V3_add_value("othername", "<unsupported>", &ret))
@@ -100,7 +101,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
         break;
 
     case GEN_DIRNAME:
-        if (X509_NAME_oneline(gen->d.dirn, oline, 256) == NULL
+        if (X509_NAME_oneline(gen->d.dirn, oline, sizeof(oline)) == NULL
                 || !X509V3_add_value("DirName", oline, &ret))
             return NULL;
         break;