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> (cherry picked from commit 012aa9ec76b158179b4de44bb5de8b8472045eac)
This commit is contained in:
parent
b1edca2a4c
commit
e5cf62b04d
@ -1034,6 +1034,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))
|
||||
@ -1073,13 +1080,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user