diff options
author | Jan Hykel <jan.hykel@acision.com> | 2014-11-16 16:51:17 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-11-17 12:40:44 +0000 |
commit | 012aa9ec76b158179b4de44bb5de8b8472045eac (patch) | |
tree | bb3d2297e2eea82ae6913b74166a540bbeb8ab4e /crypto/bio/bss_dgram.c | |
parent | 32bb5c3953ce0ff63caff7443e05eb0da5f4c461 (diff) |
Don't use msg on error.
Don't attempt to access msg structure if recvmsg returns an error.
PR#3483
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/bio/bss_dgram.c')
-rw-r--r-- | crypto/bio/bss_dgram.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 8a55c1521b..8a1eb6de8b 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -1082,6 +1082,13 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) msg.msg_flags = 0; n = recvmsg(b->num, &msg, 0); + if (n <= 0) + { + if (n < 0) + ret = n; + break; + } + if (msg.msg_controllen > 0) { for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) @@ -1121,13 +1128,6 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) } } - if (n <= 0) - { - if (n < 0) - ret = n; - break; - } - if (msg.msg_flags & MSG_NOTIFICATION) { snp = (union sctp_notification*) out; |