Unsigned overflow. Found by Brian Carpenter
Fixes #3889
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3890)
(cherry picked from commit
a7ff57965b81ce4fd73a18266ce29abf6b909fdb)
const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
- return ap->id - bp->id;
+ if (ap->id == bp->id)
+ return 0;
+ return ap->id < bp->id ? -1 : 1;
}
void ssl_sort_cipher_list(void)