3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-04 19:19:23 +01:00

unit: Fix asan warning

==24642==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe00450850 at pc 0x7f2043eef5e3 bp 0x7ffe00450660 sp 0x7ffe0044fdf0
WRITE of size 3 at 0x7ffe00450850 thread T0
    #0 0x7f2043eef5e2 in __interceptor_vsprintf /var/tmp/portage/sys-devel/gcc-8.2.0-r2/work/gcc-8.2.0/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1522
    #1 0x7f2043eef956 in __interceptor_sprintf /var/tmp/portage/sys-devel/gcc-8.2.0-r2/work/gcc-8.2.0/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1553
    #2 0x4026f1 in prf_test unit/test-prf-sha1.c:64
    #3 0x407478 in l_test_run ell/test.c:83
    #4 0x4029e3 in main unit/test-prf-sha1.c:130
    #5 0x7f2042dd9ed9 in __libc_start_main (/lib64/libc.so.6+0x20ed9)
    #6 0x401f79 in _start (/home/denkenz/iwd-master/unit/test-prf-sha1+0x401f79)
This commit is contained in:
Denis Kenzior 2019-01-11 11:34:49 -06:00
parent 3063c4968a
commit 6bf7e638b0

View File

@ -46,7 +46,7 @@ static void prf_test(const void *data)
const struct prf_data *test = data;
unsigned int prf_len;
unsigned char output[512];
char prf[128];
char prf[1024];
unsigned int i;
bool result;