bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asan report in history_tokenize_word


From: Grisha Levit
Subject: asan report in history_tokenize_word
Date: Tue, 7 Mar 2023 03:50:07 -0500

This happens with yank-last-arg when the last arg ends with a backslash:

INPUTRC=/dev/null ./bash --norc -in <<<$'\\\n\e_'

==38861==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x00010390cfb2 at pc 0x000100622c18 bp 0x00016fdf1410 sp
0x00016fdf1408
READ of size 1 at 0x00010390cfb2 thread T0

    frame #5: 0x0000000100622c18
bash`history_tokenize_word(string="\\", ind=0) at histexpand.c:1556:10
    frame #6: 0x000000010061b238
bash`history_tokenize_internal(string="\\", wind=-1,
indp=0x0000000000000000) at histexpand.c:1653:11
    frame #7: 0x000000010061a894 bash`history_tokenize(string="\\") at
histexpand.c:1686:11
    frame #8: 0x0000000100619aec bash`history_arg_extract(first=36,
last=36, string="\\") at histexpand.c:1430:15
    frame #9: 0x00000001005d333c
bash`rl_yank_nth_arg_internal(count=36, key=95, history_skip=0) at
kill.c:628:9
    frame #10: 0x00000001005d3768 bash`rl_yank_last_arg(count=1,
key=95) at kill.c:698:14
    frame #11: 0x00000001004fe830 bash`_rl_dispatch_subseq(key=95,
map=0x00000001007def40, got_subseq=0) at readline.c:922:8
    frame #12: 0x00000001005009dc bash`_rl_dispatch_subseq(key=27,
map=0x00000001007ddb20, got_subseq=0) at readline.c:1068:8
    frame #13: 0x00000001004fc434 bash`_rl_dispatch(key=27,
map=0x00000001007ddb20) at readline.c:866:10

(lldb) fr v string i
(const char *) string = 0x000000010390cfb0 "\\"
(int) i = 2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]