1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

r2665: Ensure the UNIX info level returned enough data.

Jeremy.
(This used to be commit 8a7741dddf17dca136144fb26e2d7a42d313467a)
This commit is contained in:
Jeremy Allison 2004-09-26 22:16:00 +00:00 committed by Gerald (Jerry) Carter
parent eb9a09954b
commit f128aa2a55

View File

@ -205,6 +205,12 @@ BOOL cli_unix_stat(struct cli_state *cli, const char *name, SMB_STRUCT_STAT *sbu
return False; 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_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 = IVAL2_TO_SMB_BIG_UINT(rdata,8); /* number of blocks allocated */
sbuf->st_blocks /= STAT_ST_BLOCKSIZE; sbuf->st_blocks /= STAT_ST_BLOCKSIZE;