Re: uninitialized variable access in read_builtin

2023-06-22 Thread Chet Ramey
On 6/22/23 12:36 PM, Grisha Levit wrote: `read' can hit its timeout before it gets a chance to save the current signal mask so sigprocmask can end up restoring an uninitialized prevset. (Also all the sigprocmask calls other than the one in the jmp target are protected by `#if defined (SIGCHLD)' s

temp env vs export

2023-06-22 Thread Grisha Levit
Using `export' / `readonly' on a variable that's present in both the temp env and a calling function's local context combines the attributes of all the intervening scopes in the global variable: $ declare -A v; f() { local -a v; v= e; }; e() { export v; } $ (f; declare -p v) declare -aAx v=([0]=""

uninitialized variable access in read_builtin

2023-06-22 Thread Grisha Levit
`read' can hit its timeout before it gets a chance to save the current signal mask so sigprocmask can end up restoring an uninitialized prevset. (Also all the sigprocmask calls other than the one in the jmp target are protected by `#if defined (SIGCHLD)' so I guess this one should be too) Found by

Re: [PATCH] null pointer deref in bindpwd

2023-06-22 Thread Chet Ramey
On 6/17/23 2:57 AM, Grisha Levit wrote: Only triggered by doing something stupid: bash -c 'declare -n OLDPWD=X[SHLVL=-1]; /; cd /' bash: line 1: X[SHLVL=-1]: bad array subscript Segmentation fault: 11 Thanks for the report. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: [PATCH] fix compgen -V leak

2023-06-22 Thread Chet Ramey
On 6/17/23 2:49 AM, Grisha Levit wrote: My earlier patch for adding compgen -V did the variable assignment in a pretty silly way and had a small memory leak to boot. Hope this new way makes sense, sorry for the extra work. Thanks for the update. Chet -- ``The lyf so short, the craft so long t

Re: [PATCH] uninitialized variable access

2023-06-22 Thread Chet Ramey
On 6/17/23 2:55 AM, Grisha Levit wrote: Some uninitialized variable access identified by clang's static analyzer. (FWIW 90% of the reports were bogus but these seem legit) Thanks for the report and wading through the false positives. Chet -- ``The lyf so short, the craft so long to lerne.'' -