From 0167f8d036eebbb262ce78f6fd594ebacea8fa6c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 20 Jan 2004 10:55:24 +0000 Subject: 19385: NULL dereference in add_match_part --- ChangeLog | 5 +++++ Src/Zle/compmatch.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a853cf0b..1e80030b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-20 Peter Stephenson + + * Bob Schmertz: 19385: Src/compmatch.c: protect against calling + add_match_part with NULL pointers. + 2004-01-19 Peter Stephenson * Vincent Stemen : users/7011: diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 74b2725eb..b99db2e6e 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -341,7 +341,7 @@ add_match_part(Cmatcher m, char *l, char *w, int wl, /* If the anchors are equal, we keep only one. */ - if (!strncmp(l, w, wl)) + if (l && !strncmp(l, w, wl)) l = NULL; /* Split the new part into parts and turn the last one into a -- cgit 1.4.1