[Pkg-wmaker-commits] [wmbiff] 08/14: fix some potential bugs - an access of freed memory and an uninitialized reference counter

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:04:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_17
in repository wmbiff.

commit 2c0286dcb5dab9cf611c9e207bbf4b9ab56b009f
Author: bluehal <bluehal>
Date:   Thu Jul 31 23:37:35 2003 +0000

    fix some potential bugs - an access of freed memory and an uninitialized reference counter
---
 wmbiff/Imap4Client.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index 3beccc4..296aafb 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -145,6 +145,7 @@ struct connection_state *unbind(
 	for (i = 0; i < FDMAP_SIZE && fdmap[i].cs != scs; i++);
 	if (i < FDMAP_SIZE) {
 		free(fdmap[i].user_server_port);
+		fdmap[i].user_server_port = NULL;
 		retval = fdmap[i].cs;
 		fdmap[i].cs = NULL;
 	}
@@ -428,6 +429,7 @@ void imap_cacheHeaders( /*@notnull@ */ Pop3 pc)
 						m->subj);
 				m->next = pc->headerCache;
 				pc->headerCache = m;
+				pc->headerCache->in_use = 0; /* initialize that it isn't locked */
 			} else {
 				IMAP_DM(pc, DEBUG_ERROR, "error fetching: %s", hdrbuf);
 			}
@@ -439,6 +441,8 @@ void imap_cacheHeaders( /*@notnull@ */ Pop3 pc)
 	IMAP_DM(pc, DEBUG_INFO, "worked headers\n");
 }
 
+/* a client is asking for the headers, hand em a reference, increase the
+   one-bit reference counter */
 struct msglst *imap_getHeaders( /*@notnull@ */ Pop3 pc)
 {
 	if (pc->headerCache == NULL)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list