[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 8/8] net/socket: fix coverity issue
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL 8/8] net/socket: fix coverity issue |
Date: |
Tue, 14 Nov 2017 10:11:38 +0800 |
From: Jens Freimann <address@hidden>
This fixes coverity issue CID1005339.
Make sure that saddr is not used uninitialized if the
mcast parameter is NULL.
Cc: address@hidden
Reported-by: Peter Maydell <address@hidden>
Signed-off-by: Jens Freimann <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
net/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/socket.c b/net/socket.c
index 83a2a31..6917fbc 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -373,7 +373,7 @@ static NetSocketState
*net_socket_fd_init_dgram(NetClientState *peer,
net_socket_read_poll(s, true);
/* mcast: save bound address as dst */
- if (is_connected) {
+ if (is_connected && mcast != NULL) {
s->dgram_dst = saddr;
snprintf(nc->info_str, sizeof(nc->info_str),
"socket: fd=%d (cloned mcast=%s:%d)",
--
2.7.4
- [Qemu-devel] [PULL 2/8] colo-compare: Insert packet into the suitable position of packet queue directly, (continued)
- [Qemu-devel] [PULL 2/8] colo-compare: Insert packet into the suitable position of packet queue directly, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 3/8] colo-compare: compare the packet in a specified Connection, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 4/8] colo-compare: Fix comments, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 6/8] Fix eepro100 simple transmission mode, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 5/8] colo: Consolidate the duplicate code chunk into a routine, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 7/8] Add new PCI ID for i82559a, Jason Wang, 2017/11/13
- [Qemu-devel] [PULL 8/8] net/socket: fix coverity issue,
Jason Wang <=
- Re: [Qemu-devel] [PULL 0/8] Net patches, Peter Maydell, 2017/11/14