]> git.llucax.com Git - software/mutt-debian.git/blob - debian/patches/upstream/493719-segfault-imap-close.patch
upstream/578087-header-strchr.patch: prevent from segfaulting on malformed messages...
[software/mutt-debian.git] / debian / patches / upstream / 493719-segfault-imap-close.patch
1 IMAP: only close socket when not already disconnected.
2 closes http://bugs.mutt.org/3161 and
3 http://bugs.debian.org/493719
4
5 --- a/imap/imap.c
6 +++ b/imap/imap.c
7 @@ -488,8 +488,11 @@
8  
9  void imap_close_connection(IMAP_DATA* idata)
10  {
11 -  mutt_socket_close (idata->conn);
12 -  idata->state = IMAP_DISCONNECTED;
13 +  if (idata->state != IMAP_DISCONNECTED)
14 +  {
15 +    mutt_socket_close (idata->conn);
16 +    idata->state = IMAP_DISCONNECTED;
17 +  }
18    idata->seqno = idata->nextcmd = idata->lastcmd = idata->status = 0;
19    memset (idata->cmds, 0, sizeof (IMAP_COMMAND) * idata->cmdslots);
20  }