]> git.ipfire.org Git - thirdparty/util-linux.git/commit
colcrt: avoid writing beyond array bound [afl & asan]
authorSami Kerola <kerolasa@iki.fi>
Sun, 9 Aug 2015 17:16:34 +0000 (18:16 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 10 Aug 2015 20:48:38 +0000 (21:48 +0100)
commitd883d64d96ab9bef510745d064a351145b9babec
tree2aff8ccbba4b8411029fb26fc3f2b99a9c7566c9
parent3a41cdd7b5e1c8512553dfce27ca364f6a68a4f9
colcrt: avoid writing beyond array bound [afl & asan]

text-utils/colcrt.c:205:10: runtime error: index -1 out of bounds for type 'wchar_t [133]'
SUMMARY: AddressSanitizer: undefined-behavior text-utils/colcrt.c:205
=================================================================
==2357==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000013811b0 at pc 0x0000004e2514 bp 0x7ffdf6ba4450 sp 0x7ffdf6ba4448
READ of size 4 at 0x0000013811b0 thread T0
    #0 0x4e2513 in colcrt /home/src/util-linux/text-utils/colcrt.c:213:8
    #1 0x4e17d4 in main /home/src/util-linux/text-utils/colcrt.c:139:3
    #2 0x7fb77236960f in __libc_start_main (/usr/lib/libc.so.6+0x2060f)
    #3 0x4362c8 in _start (/home/src/util-linux/colcrt+0x4362c8)

Reported-by: Alaa Mubaied <alaamubaied@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/colcrt.c