s3-libsmbclient: Fix crash bug in SMBC_parse_path().
authorGünther Deschner <gd@samba.org>
Thu, 14 Jan 2010 18:34:26 +0000 (19:34 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 14 Jan 2010 18:48:33 +0000 (19:48 +0100)
Patch from Tim Waugh <twaugh@redhat.com>.
This resolves https://bugzilla.redhat.com/show_bug.cgi?id=552658

LIBSMBCLIENT-OPENDIR torture test checks this as well.

Guenther

source3/libsmb/libsmb_path.c

index 9d2eafc8d776b20948dcdef053e409ccf7138b24..64a956d9ee4ee25e2dbb8a6dd984dbf61a0a024a 100644 (file)
@@ -308,7 +308,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
                if (!*pp_server) {
                        return -1;
                }
                if (!*pp_server) {
                        return -1;
                }
-                       *pp_server[wl] = '\0';
+               (*pp_server)[wl] = '\0';
                return 0;
        }
 
                return 0;
        }