summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-09-26 22:16:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:49 -0500
commitf128aa2a550f3672b2d12786ab4bf59e6d749c7a (patch)
treeeb6141a4526b993978cf11d2cde5360d01865d6f
parenteb9a09954b97f78768f07cbb921c05b06321d5ec (diff)
downloadsamba-f128aa2a550f3672b2d12786ab4bf59e6d749c7a.tar.gz
samba-f128aa2a550f3672b2d12786ab4bf59e6d749c7a.tar.bz2
samba-f128aa2a550f3672b2d12786ab4bf59e6d749c7a.zip
r2665: Ensure the UNIX info level returned enough data.
Jeremy. (This used to be commit 8a7741dddf17dca136144fb26e2d7a42d313467a)
-rw-r--r--source3/libsmb/clifile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index d302206949..144fc4a0c8 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -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;