diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-01-26 23:47:20 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-01-26 23:47:20 +0200 |
commit | e54e6b0219743b45d10b676a1b4df95c8611146b (patch) | |
tree | 113148ea2242ba22536a2b45cb406dbceab0c28d /imap4d | |
parent | 2a8bb2172c030edd7b161e6e54088aeed8ed6d5c (diff) | |
download | mailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.gz mailutils-e54e6b0219743b45d10b676a1b4df95c8611146b.tar.bz2 |
Minor fix
* imap4d/search.c (parse_search_key): Fix eventual NULL pointer dereference.
Diffstat (limited to 'imap4d')
-rw-r--r-- | imap4d/search.c | 10 |
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) 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); |