[Bug 8355] New: Use pointer after freeaddrinfo()

samba-bugs at samba.org samba-bugs at samba.org
Fri Aug 5 14:01:45 MDT 2011


https://bugzilla.samba.org/show_bug.cgi?id=8355

           Summary: Use pointer after freeaddrinfo()
           Product: rsync
           Version: 3.0.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P5
         Component: core
        AssignedTo: wayned at samba.org
        ReportedBy: andrey at zonov.org
         QAContact: rsync-qa at samba.org


Build and install rsync 3.0.8 then try to connect unavaliable host and you've
got segmentation fault.

$ rsync rsync://10.0.0.1
rsync: failed to connect to 10.0.0.1 (10.0.0.1): Operation timed out (60)
Segmentation fault: 11

There's an error in open_socket_out() function in socket.c. It's need to call
freeaddrinfo() in the end of the function. Like this:

--- socket.c.orig       2011-08-05 23:55:06.000000000 +0400
+++ socket.c    2011-08-05 23:55:17.000000000 +0400
@@ -299,7 +299,6 @@
                }
                break;
        }
-       freeaddrinfo(res0);

        if (s < 0) {
                char buf[2048];
@@ -313,6 +312,7 @@
                s = -1;
        }

+       freeaddrinfo(res0);
        free(errnos);

        return s;

but there is an another error over calling inet_ntop().

Full patch is in attachment.

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the rsync mailing list