From 6bf7e638b0bf59580b0704c5c87256ccc720ad99 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 11 Jan 2019 11:34:49 -0600 Subject: [PATCH] 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) --- unit/test-prf-sha1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit/test-prf-sha1.c b/unit/test-prf-sha1.c index 7461dbea..90ab34b2 100644 --- a/unit/test-prf-sha1.c +++ b/unit/test-prf-sha1.c @@ -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;