Fix bug #8341 - libsmbclient segfault when feed the root of a mounted share via an uri
authorAlban Browaeys <prahal@yahoo.com>
Mon, 1 Aug 2011 23:40:22 +0000 (16:40 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sun, 7 Aug 2011 19:02:43 +0000 (21:02 +0200)
Fix null deref.
(cherry picked from commit cf0c36ab9a5129878b92a52d22aa814eaa737a4c)
(cherry picked from commit ca293af1f06891dfd13171d418047e4fa8c4fc14)

source3/libsmb/clifsinfo.c

index 94568c9f30d12c93721c18e1497c9bc738a87633..95973bb4b76e8bc8cb84a4f0a877fff140c5883c 100644 (file)
@@ -472,6 +472,7 @@ NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
        uint16 setup[1];
        uint8_t param[2];
        uint8_t *rdata = NULL;
        uint16 setup[1];
        uint8_t param[2];
        uint8_t *rdata = NULL;
+       uint32_t rdata_count;
        NTSTATUS status;
 
        SSVAL(setup, 0, TRANSACT2_QFSINFO);
        NTSTATUS status;
 
        SSVAL(setup, 0, TRANSACT2_QFSINFO);
@@ -484,7 +485,7 @@ NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
                           NULL,
                           NULL, 0, NULL, /* rsetup */
                           NULL, 0, NULL, /* rparam */
                           NULL,
                           NULL, 0, NULL, /* rsetup */
                           NULL, 0, NULL, /* rparam */
-                          &rdata, 56, NULL);
+                          &rdata, 56, &rdata_count);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }