[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
compute_lcd_of_matches w/ mismatched upper/lowercase byte counts
From: |
Grisha Levit |
Subject: |
compute_lcd_of_matches w/ mismatched upper/lowercase byte counts |
Date: |
Fri, 24 May 2024 04:02:44 -0400 |
This requires case-insensitive completion of two+ words where the the
prefix in a word contains the single-byte lowercase form of the multi-
byte character occuring in the same position in an earlier word.
The words here start consist of one of the following followed by `-':
U+212A KELVIN SIGN
U+006B LATIN SMALL LETTER K
Reproducer:
echo 'set completion-ignore-case on' > irc
INPUTRC=irc bash --norc -i <<< $'complete -W "\u212A- k-" f\nf \t'
=================================================================
==2838==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x00397f5ee2b3
READ of size 1 at 0x00397f5ee2b3 thread T0
#0 0x587fdb10e8 in compute_lcd_of_matches lib/readline/complete.c:1388:54
#1 0x587fdb0428 in rl_completion_matches lib/readline/complete.c:2330:5
#2 0x587fbbc7f8 in attempt_shell_completion bashline.c:1769:14
#3 0x587fdab1b4 in gen_completion_matches lib/readline/complete.c:1260:17
0x00397f5ee2b3 is located 0 bytes after 3-byte region
[0x00397f5ee2b0,0x00397f5ee2b3)
allocated by thread T0 here:
#0 0x6fe1752874 in malloc
(/data/data/com.termux/files/usr/lib/clang/18/lib/linux/libclang_rt.asan-aarch64-android.so+0xed874)
#1 0x587fc1b2c4 in xmalloc xmalloc.c:104:10
#2 0x587fd34944 in strlist_copy lib/sh/stringlist.c:126:17
#3 0x587fd366a0 in strlist_append lib/sh/stringlist.c:164:18
#4 0x587fc080a0 in gen_compspec_completions pcomplete.c:1311:10
#5 0x587fc118d8 in gen_progcomp_completions pcomplete.c:1528:9
#6 0x587fc108fc in programmable_completions pcomplete.c:1581:13
#7 0x587fbbbccc in attempt_shell_completion bashline.c:1718:28
#8 0x587fdab1b4 in gen_completion_matches lib/readline/complete.c:1260:17
- compute_lcd_of_matches w/ mismatched upper/lowercase byte counts,
Grisha Levit <=