summaryrefslogtreecommitdiffstats
path: root/ssl/statem/statem_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-09-12 02:31:10 +0200
committerRichard Levitte <levitte@openssl.org>2018-10-29 14:20:37 +0100
commit60690b5b8396d7d5234cd067206190fb8aca78d2 (patch)
treed4a40d95326c63f51afea13fda02330e455366fc /ssl/statem/statem_lib.c
parentVMS & cryptoerr.h: include symhacks.h (diff)
downloadopenssl-60690b5b8396d7d5234cd067206190fb8aca78d2.tar.xz
openssl-60690b5b8396d7d5234cd067206190fb8aca78d2.zip
ssl/statem: Don't compare size_t with less than zero
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7194)
Diffstat (limited to '')
-rw-r--r--ssl/statem/statem_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 508bb88767..e6e61f7876 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -203,9 +203,10 @@ static int get_cert_verify_tbs_data(SSL *s, unsigned char *tls13tbs,
*hdatalen = TLS13_TBS_PREAMBLE_SIZE + hashlen;
} else {
size_t retlen;
+ long retlen_l;
- retlen = BIO_get_mem_data(s->s3->handshake_buffer, hdata);
- if (retlen <= 0) {
+ retlen = retlen_l = BIO_get_mem_data(s->s3->handshake_buffer, hdata);
+ if (retlen_l <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_GET_CERT_VERIFY_TBS_DATA,
ERR_R_INTERNAL_ERROR);
return 0;