summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-12-27 11:22:05 +0100
committerTomas Mraz <tomas@openssl.org>2023-01-04 16:52:00 +0100
commit0a69ca8f635f88b0488c5684410f97e22346c0bc (patch)
tree84ec577ba87f807513cb84c5cb27e14de705539a /ssl
parent5b449de0f0a185459916a0aaff0ff1f5f87b56b9 (diff)
Avoid possible divide by zero
Backport of commit 624efd2 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19967) (cherry picked from commit 8c29e5ebfd5f19442422ba43fea4c95816417e34)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/ssl3_record.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c
index dcaaeef951..368aaea5e9 100644
--- a/ssl/record/ssl3_record.c
+++ b/ssl/record/ssl3_record.c
@@ -1314,7 +1314,7 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int sending)
}
t = EVP_MD_CTX_get_size(hash);
- if (t < 0)
+ if (t <= 0)
return 0;
md_size = t;
npad = (48 / md_size) * md_size;