[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen stable-4.10] net/socket: fix coverity issue



commit 957bd48acfc350fd9b05669fb55cb61b004dd7bb
Author:     Jens Freimann <jfreimann@xxxxxxxxxx>
AuthorDate: Mon Nov 6 15:05:46 2017 +0100
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Wed Dec 6 09:43:29 2017 -0600

    net/socket: fix coverity issue
    
    This fixes coverity issue CID1005339.
    
    Make sure that saddr is not used uninitialized if the
    mcast parameter is NULL.
    
    Cc: qemu-stable@xxxxxxxxxx
    Reported-by: Peter Maydell <peter.maydell@xxxxxxxxxx>
    Signed-off-by: Jens Freimann <jfreimann@xxxxxxxxxx>
    Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
    (cherry picked from commit bb160b571fe469b03228d4502c75a18045978a74)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 net/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/socket.c b/net/socket.c
index 18af2ab..6664a75 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -369,7 +369,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)",
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.10

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.