aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2018-11-25 00:56:53 +0100
committerMatthias Andree <matthias.andree@gmx.de>2018-11-25 00:56:53 +0100
commit8c57ec38ae327fcd648569acc915f47f0eb2547d (patch)
tree7cd4cb8681c0e5950a24b10c9b568f5dc6f58c13
parent295ff6340f665d58e369035ffa4257f2f84553d6 (diff)
downloadfetchmail-8c57ec38ae327fcd648569acc915f47f0eb2547d.tar.gz
fetchmail-8c57ec38ae327fcd648569acc915f47f0eb2547d.tar.bz2
fetchmail-8c57ec38ae327fcd648569acc915f47f0eb2547d.zip
Fix potential SIGSEGV in pop3_delete.
Reported by Paul Kinsler.
-rw-r--r--pop3.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pop3.c b/pop3.c
index fb466902..907a5879 100644
--- a/pop3.c
+++ b/pop3.c
@@ -1370,8 +1370,9 @@ static int pop3_delete(int sock, struct query *ctl, int number)
if (ok != PS_SUCCESS)
return(ok);
- rec = find_uid_by_num(dofastuidl ? &ctl->oldsaved : &ctl->newsaved, number);
- rec->status = UID_DELETED;
+ if ((rec = find_uid_by_num(dofastuidl ? &ctl->oldsaved : &ctl->newsaved, number)))
+ rec->status = UID_DELETED;
+
return(PS_SUCCESS);
}