bug-bash
[Top][All Lists]
Advanced

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

Re: segfault on initial word completion


From: Grisha Levit
Subject: Re: segfault on initial word completion
Date: Fri, 21 Apr 2023 13:15:24 -0400

On Wed, Apr 19, 2023, 10:23 Chet Ramey <chet.ramey@case.edu> wrote:

> On 4/18/23 6:15 PM, Grisha Levit wrote:
> > $ bash --rcfile <(echo 'complete -C: -I') -i <<<$'; \cA\t'
> > bash-5.2$ bash: xmalloc: cannot allocate 18446744073709551615 bytes
> > $ bash --rcfile <(echo 'complete -C: -I') -i <<<$';\cA \t'
> > bash-5.2$  Segmentation fault: 11
> >
>
> Thanks for the report.
>

One more issue after the fix, the start can end up being further than
pcomp_ind

bash --rcfile <(echo 'complete -C: -I') -i <<<$' \cA\t'

ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 1 at 0x0044e7a7d22f thread T0
    #0 0x63e8175148 in bind_compfunc_variables pcomplete.c:946:7
    #1 0x63e816afb0 in gen_command_matches pcomplete.c:1179:3
    #2 0x63e8165358 in gen_compspec_completions pcomplete.c:1389:18
    #3 0x63e81700e0 in gen_progcomp_completions pcomplete.c:1539:9
    #4 0x63e816eb7c in programmable_completions pcomplete.c:1592:13
    #5 0x63e810b4b8 in attempt_shell_completion bashline.c:1745:26


reply via email to

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