summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-01-26 14:55:28 +0000
committerHugo Landau <hlandau@openssl.org>2023-02-22 05:34:05 +0000
commit533390e46f8e2ea55d66d35fd54e724c2fb77571 (patch)
treef818d2234db283aafc38969fde54213a8bdbba02 /crypto
parent7eaaaaaa559d56edc9732d768dc374a4f829b187 (diff)
downloadopenssl-new-533390e46f8e2ea55d66d35fd54e724c2fb77571.tar.gz
Ensure calling BIO_recvmmsg() with a dgram pair reports errors
When calling BIO-recvmmsg() and using a dgram pair we were failing to raise an error in the case that a problem occurs. This means that the reason behind a failure cannot be detected and all problems are treated as fatal even if they may not be. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20030)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bio/bss_dgram_pair.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bss_dgram_pair.c b/crypto/bio/bss_dgram_pair.c
index b80fa62e48..3685d51f55 100644
--- a/crypto/bio/bss_dgram_pair.c
+++ b/crypto/bio/bss_dgram_pair.c
@@ -1066,10 +1066,12 @@ static int dgram_pair_recvmmsg(BIO *bio, BIO_MSG *msg,
m->local, m->peer, 1);
if (l < 0) {
*num_processed = i;
- if (i > 0)
+ if (i > 0) {
ret = 1;
- else
+ } else {
+ ERR_raise(ERR_LIB_BIO, -l);
ret = 0;
+ }
goto out;
}