Fixed a null-pointer dereference pointed out by Olivier Thauvin.
authorWayne Davison <wayned@samba.org>
Thu, 16 Aug 2007 01:22:46 +0000 (01:22 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 16 Aug 2007 01:22:46 +0000 (01:22 +0000)
socket.c

index 9017007..51c07f7 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -300,7 +300,7 @@ int open_socket_out_wrapped(char *host, int port, const char *bind_addr,
 {
        char *prog = getenv("RSYNC_CONNECT_PROG");
 
-       if (strchr(prog, '%')) {
+       if (prog && strchr(prog, '%')) {
                int hlen = strlen(host);
                int len = strlen(prog) + 1;
                char *f, *t;