From: Bob Schmertz <rschmertz@yahoo.com>
To: zsh-workers@sunsite.dk
Subject: Change in glibc's strncmp -> segfault?
Date: Tue, 20 Jan 2004 01:24:48 -0800 (PST) [thread overview]
Message-ID: <20040120092448.40632.qmail@web12405.mail.yahoo.com> (raw)
Hi,
I man page for strcmp on my Linux system, and it doesn't say anything
about the behavior of strcmp or stsrncmp when null pointers are passed.
But sometimes you call add_match_part explicitly with NULL parameters for
the first six params. Two of these are immediately passed into a strncmp
call.
I upgraded my glibc on my Gentoo box in the last day or two to 2.3.2-r9.
Unfortunately, I don't know what version I had before. From around that
time, I started getting crashes when I would tab-complete a directory
name. I made it whole again by changing line 344 in compmatch.c
(downloaded v. 4.1.1 today) from
if (!strncmp(l, w, wl))
to
if (l && !strncmp(l, w, wl))
I suppose it should really be (l && w && !strncmp(...)), on the chance
that there is somewhere that you are calling add_match_part with a null w
but a non-null l, but this fixed my immediate problem. I have no idea if
this solution is "correct", but I hope at least I have pointed out the
right problem.
=====
Cheers,
Bob Schmertz
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
next reply other threads:[~2004-01-20 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-20 9:24 Bob Schmertz [this message]
2004-01-20 10:57 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040120092448.40632.qmail@web12405.mail.yahoo.com \
--to=rschmertz@yahoo.com \
--cc=robert.schmertz@terpalum.umd.edu \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).