r2665: Ensure the UNIX info level returned enough data.
authorJeremy Allison <jra@samba.org>
Sun, 26 Sep 2004 22:16:00 +0000 (22:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:49 +0000 (10:52 -0500)
Jeremy.
(This used to be commit 8a7741dddf17dca136144fb26e2d7a42d313467a)

source3/libsmb/clifile.c

index d3022069491d99ec8333987759c19d432133bee6..144fc4a0c853fd8dce5bcd2792719ff3c9531b10 100644 (file)
@@ -205,6 +205,12 @@ BOOL cli_unix_stat(struct cli_state *cli, const char *name, SMB_STRUCT_STAT *sbu
                        return False;
        }
 
+       if (data_len < 96) {
+               SAFE_FREE(rdata);
+               SAFE_FREE(rparam);
+               return False;
+       }
+
        sbuf->st_size = IVAL2_TO_SMB_BIG_UINT(rdata,0);     /* total size, in bytes */
        sbuf->st_blocks = IVAL2_TO_SMB_BIG_UINT(rdata,8);   /* number of blocks allocated */
        sbuf->st_blocks /= STAT_ST_BLOCKSIZE;