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>
This commit is contained in:
Steven Valdez 2016-02-25 13:49:45 -05:00 committed by David Benjamin
parent b0576889fa
commit fd26b7a015

View File

@ -329,7 +329,7 @@ err:
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;
}