if no comparison function set make sk_sort no op
authorDr. Stephen Henson <steve@openssl.org>
Sat, 6 Feb 2016 17:07:58 +0000 (17:07 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 6 Feb 2016 18:49:56 +0000 (18:49 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 0ca2e82ab1575f9c4eed259c4d66ca9372a45bf5)

crypto/stack/stack.c

index de437acf6a5cb6ce15984cabb243b381143eed67..fa50083e22b3b905274d45d5bf7d8714f7a008af 100644 (file)
@@ -360,7 +360,7 @@ void *sk_set(_STACK *st, int i, void *value)
 
 void sk_sort(_STACK *st)
 {
-    if (st && !st->sorted) {
+    if (st && !st->sorted && st->comp != NULL) {
         int (*comp_func) (const void *, const void *);
 
         /*