[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Rich Salz rsalz at openssl.org
Wed Mar 15 23:38:39 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  ef727bc5669182cdf8519734ae9924fc54cc4164 (commit)
       via  71683a1d36dc22229f99c5d8ccd4d45b5b1afc35 (commit)
      from  173738281046d280bcf7671b6b4218cc95f239cd (commit)


- Log -----------------------------------------------------------------
commit ef727bc5669182cdf8519734ae9924fc54cc4164
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Tue Mar 14 15:10:52 2017 +0100

    Fixed a crash in print_notice.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2935)
    (cherry picked from commit 29d1fad78899e5ae2997b19937a175784b21c996)

commit 71683a1d36dc22229f99c5d8ccd4d45b5b1afc35
Author: Pauli <paul.dale at oracle.com>
Date:   Wed Mar 15 14:29:08 2017 +1000

    Update doc for sk_TYPE_find() and sk_TYPE_find_ex()
    
    to better describe the vagaries in their behaviour.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2958)
    (cherry picked from commit 89b06ca7b0b08d31ac48275d1376a7046dd75f55)

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

Summary of changes:
 crypto/x509v3/v3_cpols.c       | 12 +++++++++---
 doc/crypto/DEFINE_STACK_OF.pod | 24 ++++++++++++++++--------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c
index f717e13..22c56ba 100644
--- a/crypto/x509v3/v3_cpols.c
+++ b/crypto/x509v3/v3_cpols.c
@@ -413,9 +413,15 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
             num = sk_ASN1_INTEGER_value(ref->noticenos, i);
             if (i)
                 BIO_puts(out, ", ");
-            tmp = i2s_ASN1_INTEGER(NULL, num);
-            BIO_puts(out, tmp);
-            OPENSSL_free(tmp);
+            if (num == NULL)
+                BIO_puts(out, "(null)");
+            else {
+                tmp = i2s_ASN1_INTEGER(NULL, num);
+                if (tmp == NULL)
+                    return;
+                BIO_puts(out, tmp);
+                OPENSSL_free(tmp);
+            }
         }
         BIO_puts(out, "\n");
     }
diff --git a/doc/crypto/DEFINE_STACK_OF.pod b/doc/crypto/DEFINE_STACK_OF.pod
index ae443b0..fbd43f9 100644
--- a/doc/crypto/DEFINE_STACK_OF.pod
+++ b/doc/crypto/DEFINE_STACK_OF.pod
@@ -140,14 +140,22 @@ sk_TYPE_set() sets element B<idx> of B<sk> to B<ptr> replacing the current
 element. The new element value is returned or B<NULL> if an error occurred:
 this will only happen if B<sk> is B<NULL> or B<idx> is out of range.
 
-sk_TYPE_find() and sk_TYPE_find_ex() search B<sk> using the supplied
-comparison function for an element matching B<ptr>. sk_TYPE_find() returns
-the index of the first matching element or B<-1> if there is no match.
-sk_TYPE_find_ex() returns a matching element or the nearest element that
-does not match B<ptr>. Note: if a comparison function is set then  B<sk> is
-sorted before the search which may change its order. If no comparison
-function is set then a linear search is made for a pointer matching B<ptr>
-and the stack is not reordered.
+sk_TYPE_find() searches B<sk> for the element B<ptr>.  In the case
+where no comparison function has been specified, the function performs
+a linear search for a pointer equal to B<ptr>. The index of the first
+matching element is returned or B<-1> if there is no match. In the case
+where a comparison function has been specified, B<sk> is sorted then
+sk_TYPE_find() returns the index of a matching element or B<-1> if there
+is no match. Note that, in this case, the matching element returned is
+not guaranteed to be the first; the comparison function will usually
+compare the values pointed to rather than the pointers themselves and
+the order of elements in B<sk> could change.
+
+sk_TYPE_find_ex() operates like sk_TYPE_find() except when a comparison
+function has been specified and no matching element is found. Instead
+of returning B<-1>, sk_TYPE_find_ex() returns the index of the element
+either before or after the location where B<ptr> would be if it were
+present in B<sk>.
 
 sk_TYPE_sort() sorts B<sk> using the supplied comparison function.
 


More information about the openssl-commits mailing list