| http://lists.gnu.org/archive/html/bug-bash/2016-07/msg00066.html |
| |
| From: Andreas Schwab <schwab@suse.de> |
| To: bug-bash@gnu.org |
| Subject: a=$* -> crash |
| Date: Wed, 27 Jul 2016 13:59:22 +0200 |
| Message-ID: <mvmbn1j2sx1.fsf@hawking.suse.de> |
| |
| (gdb) r |
| Starting program: /bin/bash -c a=\$\* |
| |
| Program received signal SIGSEGV, Segmentation fault. |
| quote_string (string=string@entry=0x0) at subst.c:3940 |
| 3940 if (*string == 0) |
| |
| diff --git a/subst.c b/subst.c |
| index 37d96f9..16ae3f0 100644 |
| --- a/subst.c |
| +++ b/subst.c |
| @@ -8575,7 +8575,7 @@ param_expand (string, sindex, quoted, expanded_something, |
| /* If we're not quoted but we still don't want word splitting, make |
| we quote the IFS characters to protect them from splitting (e.g., |
| when $@ is in the string as well). */ |
| - else if (quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS)) |
| + else if (temp != 0 && quoted == 0 && ifs_is_set && (pflags & PF_ASSIGNRHS)) |
| { |
| temp1 = quote_string (temp); |
| free (temp); |
| |
| Andreas. |
| |
| -- |
| Andreas Schwab, SUSE Labs, schwab@suse.de |
| GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 |
| "And now for something completely different." |
| |