bug-bash
[Top][All Lists]
Advanced

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

a=$* -> crash


From: Andreas Schwab
Subject: a=$* -> crash
Date: Wed, 27 Jul 2016 13:59:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

(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."



reply via email to

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