If no comparison function is set, sk_sort is a NOP

(Imported from upstream's 402fb1896b2aab5cf887127bbce964554b9c8113)

Change-Id: I80c1f952085c8fc9062d3395f211a525151c404d
Reviewed-on: https://boringssl-review.googlesource.com/7219
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c
index c584515..e893221 100644
--- a/crypto/stack/stack.c
+++ b/crypto/stack/stack.c
@@ -329,7 +329,7 @@
 void sk_sort(_STACK *sk) {
   int (*comp_func)(const void *,const void *);
 
-  if (sk == NULL || sk->sorted) {
+  if (sk == NULL || sk->comp == NULL || sk->sorted) {
     return;
   }