summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-01-26 23:47:20 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-01-26 23:47:20 +0200
commite54e6b0219743b45d10b676a1b4df95c8611146b (patch)
tree113148ea2242ba22536a2b45cb406dbceab0c28d
parent2a8bb2172c030edd7b161e6e54088aeed8ed6d5c (diff)
downloadmailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.gz
mailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.bz2
Minor fix
* imap4d/search.c (parse_search_key): Fix eventual NULL pointer dereference.
-rw-r--r--imap4d/search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/imap4d/search.c b/imap4d/search.c
index c0309434a..fdde44ba0 100644
--- a/imap4d/search.c
+++ b/imap4d/search.c
@@ -545,8 +545,14 @@ parse_search_key (struct parsebuf *pb)
545 if (parse_gettoken (pb, 1) == 0) 545 if (parse_gettoken (pb, 1) == 0)
546 return NULL; 546 return NULL;
547 547
548 if ((leftarg = parse_search_key (pb)) == NULL 548 if ((leftarg = parse_search_key (pb)) == NULL)
549 || (rightarg = parse_search_key (pb)) == NULL) 549 return NULL;
550 if (!pb->token)
551 {
552 pb->err_mesg = "Too few args";
553 return NULL;
554 }
555 if ((rightarg = parse_search_key (pb)) == NULL)
550 return NULL; 556 return NULL;
551 557
552 node = parse_alloc (pb, sizeof *node); 558 node = parse_alloc (pb, sizeof *node);

Return to:

Send suggestions and report system problems to the System administrator.