[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Rich Salz rsalz at openssl.org
Fri Dec 8 16:20:50 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  a1daedd88445397a4aebf22ba63e92c3f1977870 (commit)
      from  e167fd05b8b781bf04fcd462c0d28fae386116fe (commit)


- Log -----------------------------------------------------------------
commit a1daedd88445397a4aebf22ba63e92c3f1977870
Author: FdaSilvaYY <fdasilvayy at gmail.com>
Date:   Fri Dec 8 10:25:38 2017 -0500

    Fix an incoherent test.
    
    Pointer 'o' is set inside a local buffer, so it can't be NULL.
    Also fix coding style and add comments
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/4754)
    (cherry picked from commit cef115ff0ca4255d3decc1dda87c5418a961fd2c)

-----------------------------------------------------------------------

Summary of changes:
 crypto/objects/obj_dat.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index aca382a..8dae9e8 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -725,6 +725,10 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base_, int num,
     return (p);
 }
 
+/*
+ * Parse a BIO sink to create some extra oid's objects.
+ * Line format:<OID:isdigit or '.']><isspace><SN><isspace><LN>
+ */
 int OBJ_create_objects(BIO *in)
 {
     MS_STATIC char buf[512];
@@ -746,9 +750,9 @@ int OBJ_create_objects(BIO *in)
             *(s++) = '\0';
             while (isspace((unsigned char)*s))
                 s++;
-            if (*s == '\0')
+            if (*s == '\0') {
                 s = NULL;
-            else {
+            } else {
                 l = s;
                 while ((*l != '\0') && !isspace((unsigned char)*l))
                     l++;
@@ -756,15 +760,18 @@ int OBJ_create_objects(BIO *in)
                     *(l++) = '\0';
                     while (isspace((unsigned char)*l))
                         l++;
-                    if (*l == '\0')
+                    if (*l == '\0') {
                         l = NULL;
-                } else
+                    }
+                } else {
                     l = NULL;
+                }
             }
-        } else
+        } else {
             s = NULL;
-        if ((o == NULL) || (*o == '\0'))
-            return (num);
+        }
+        if (*o == '\0')
+            return num;
         if (!OBJ_create(o, s, l))
             return (num);
         num++;


More information about the openssl-commits mailing list