summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/libsmb/clifile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/libsmb/clifile.c b/source/libsmb/clifile.c
index d3022069491..144fc4a0c85 100644
--- a/source/libsmb/clifile.c
+++ b/source/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;