Commit 012aa9ec authored by Jan Hykel's avatar Jan Hykel Committed by Dr. Stephen Henson
Browse files

Don't use msg on error.



Don't attempt to access msg structure if recvmsg returns an error.

PR#3483
Reviewed-by: default avatarStephen Henson <steve@openssl.org>
Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
parent 32bb5c39
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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;