summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-01-26 21:47:20 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-01-26 21:47:20 (GMT)
commite54e6b0219743b45d10b676a1b4df95c8611146b (patch) (side-by-side diff)
tree113148ea2242ba22536a2b45cb406dbceab0c28d
parent2a8bb2172c030edd7b161e6e54088aeed8ed6d5c (diff)
downloadmailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.gz
mailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.bz2
Minor fix
* imap4d/search.c (parse_search_key): Fix eventual NULL pointer dereference.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--imap4d/search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/imap4d/search.c b/imap4d/search.c
index c030943..fdde44b 100644
--- a/imap4d/search.c
+++ b/imap4d/search.c
@@ -545,8 +545,14 @@ parse_search_key (struct parsebuf *pb)
if (parse_gettoken (pb, 1) == 0)
return NULL;
- if ((leftarg = parse_search_key (pb)) == NULL
- || (rightarg = parse_search_key (pb)) == NULL)
+ if ((leftarg = parse_search_key (pb)) == NULL)
+ return NULL;
+ if (!pb->token)
+ {
+ pb->err_mesg = "Too few args";
+ return NULL;
+ }
+ if ((rightarg = parse_search_key (pb)) == NULL)
return NULL;
node = parse_alloc (pb, sizeof *node);

Return to:

Send suggestions and report system problems to the System administrator.