1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

torture: Provide enough space for test EA name in raw.eas test

The issue is that previously bad_ea_name[5] was the last element on
the array, and so when we later did a strlen() on it, we read past the
end of the stack array.  We need bad_ea_name[5] to be the second-last
element, followed by the \0 placed there by the strlcpy().

Found by AddressSanitizer

Change-Id: I871c08200aa2591c612dfa44da92b83132f83d88
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Sep 11 08:50:16 CEST 2014 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2014-09-02 14:38:11 +12:00
parent 1c00533bc0
commit 01d4c0e804

View File

@ -51,7 +51,7 @@ static bool test_eas(struct smbcli_state *cli, struct torture_context *tctx)
union smb_open io;
const char *fname = BASEDIR "\\ea.txt";
bool ret = true;
char bad_ea_name[6];
char bad_ea_name[7];
int i;
int fnum = -1;