From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15567 invoked by alias); 9 Mar 2015 18:56:53 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 15525 invoked by uid 48); 9 Mar 2015 18:56:50 -0000 From: "konstantin.s.serebryany at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/18096] null deref in wordexp/parse_dollars/parse_arith Date: Mon, 09 Mar 2015 18:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: konstantin.s.serebryany at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00085.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18096 --- Comment #2 from Kostya Serebryany --- One more case: char *p = strdup("[a:*${C?}"); ==3359== at 0x4F1EF33: parse_param (wordexp.c:1843) ==3359== by 0x4F1EF33: parse_dollars (wordexp.c:2102) ==3359== by 0x4F20598: parse_glob (wordexp.c:490) ==3359== by 0x4F20598: wordexp (wordexp.c:2416) This time, the bug is here: @@ -1841,7 +1841,7 @@ envsubst: { const char *str = pattern; - if (str[0] == '\0') + if (str && str[0] == '\0') str = _("parameter null or not set"); __fxprintf (NULL, "%s: %s\n", env, str); An interesting side question: is wordexp supposed to print anything? -- You are receiving this mail because: You are on the CC list for the bug.