{"action":"opened","issue":{"url":"https://api.github.com/repos/marc-q/libwav/issues/23","repository_url":"https://api.github.com/repos/marc-q/libwav","labels_url":"https://api.github.com/repos/marc-q/libwav/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/marc-q/libwav/issues/23/comments","events_url":"https://api.github.com/repos/marc-q/libwav/issues/23/events","html_url":"https://github.com/marc-q/libwav/issues/23","id":343297494,"node_id":"MDU6SXNzdWUzNDMyOTc0OTQ=","number":23,"title":"SEGV in function wav_write in libwav.c","user":{"login":"fouzhe","id":17958943,"node_id":"MDQ6VXNlcjE3OTU4OTQz","avatar_url":"https://avatars1.githubusercontent.com/u/17958943?v=4","gravatar_id":"","url":"https://api.github.com/users/fouzhe","html_url":"https://github.com/fouzhe","followers_url":"https://api.github.com/users/fouzhe/followers","following_url":"https://api.github.com/users/fouzhe/following{/other_user}","gists_url":"https://api.github.com/users/fouzhe/gists{/gist_id}","starred_url":"https://api.github.com/users/fouzhe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fouzhe/subscriptions","organizations_url":"https://api.github.com/users/fouzhe/orgs","repos_url":"https://api.github.com/users/fouzhe/repos","events_url":"https://api.github.com/users/fouzhe/events{/privacy}","received_events_url":"https://api.github.com/users/fouzhe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-21T04:54:03Z","updated_at":"2018-07-21T04:54:03Z","closed_at":null,"author_association":"NONE","body":"I use **Clang 6.0 and AddressSanitizer**  to build **libwav**, this [file](https://github.com/fouzhe/security/blob/master/libwav/wav_gain__crash__wav_write) can cause SEGV signal in function `wav_write`  in `libwav.c` when running the  `wav_gain` in folder `tools/wav_gain` with the following command:\r\n\r\n```shell\r\n./wav_gain wav_gain__crash__wav_write 1.wav\r\n```\r\n\r\n\r\n\r\nThis is the ASAN information:\r\n\r\n```\r\nLibWAV v. 0.0.1 A (c) 2016 - 2017 Marc Volker Dickmann\r\n\r\nAddressSanitizer:DEADLYSIGNAL\r\n=================================================================\r\n==32413==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000004fffc0 bp 0x000000000000 sp 0x7fffefa377d0 T0)\r\n==32413==The signal is caused by a READ memory access.\r\n==32413==Hint: address points to the zero page.\r\n    #0 0x4fffbf in __sanitizer::StackDepotPut(__sanitizer::StackTrace) /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h:65\r\n    #1 0x42324b in __asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/asan/asan_allocator.cc:496\r\n    #2 0x423f46 in __asan::asan_malloc(unsigned long, __sanitizer::BufferedStackTrace*) /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/asan/asan_allocator.cc:856\r\n    #3 0x4de114 in __interceptor_malloc /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:89\r\n    #4 0x7f9ea1723cdc  (/lib/x86_64-linux-gnu/libc.so.6+0x6dcdc)\r\n    #5 0x49627a in __interceptor_fopen /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:5528\r\n    #6 0x51719d in wav_write /home/fouzhe/my_fuzz/libwav/tools/wav_gain/../../libwav.c:202:12\r\n    #7 0x518b10 in gain_file /home/fouzhe/my_fuzz/libwav/tools/wav_gain/wav_gain.c:28:6\r\n    #8 0x518b10 in main /home/fouzhe/my_fuzz/libwav/tools/wav_gain/wav_gain.c:43\r\n    #9 0x7f9ea16d682f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)\r\n    #10 0x419f08 in _start (/home/fouzhe/my_fuzz/libwav/tools/wav_gain/wav_gain+0x419f08)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV /home/fouzhe/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h:65 in __sanitizer::StackDepotPut(__sanitizer::StackTrace)\r\n==32413==ABORTING\r\n```\r\n"}}
{"actor":{"display_login":"fouzhe"}}