I'm sending a new list.diff as attachment which includes a oneliner in
imaputils. Esp that last one (a memset call) seems to fix the imaploop.
I hope you can still manage to test this for me Sean.
Thanks for your help.
Sean Chittenden wrote:
How about this one...
This doesn't solve the problem, but it should be applied anyway. A few
comments below.
+/*
+ * return a empty initialized element;
+ */
+static struct element *element_new(void)
+{
+ struct element *new = (struct element *)my_malloc(sizeof(struct
element));
+ if (new != NULL) {
+ bzero(new,sizeof(struct element));
+ new->data = NULL;
+ new->dsize = NULL;
+ new->nextnode = NULL;
The point of the bzero(3) call is so that you don't have to set data,
dsize, nextnode, etc. to NULL. I'd remove those for now, they're not
needed. Is there a list init call that needs to be added to imap4.c,
similar to what was applied to pop3.c? -sc
--
________________________________________________________________
Paul Stevens [EMAIL PROTECTED]
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands_______________________________________www.nfg.nl
diff -urNad dbmail-2.0.1/imaputil.c /tmp/dpep.cZz5za/dbmail-2.0.1/imaputil.c
--- dbmail-2.0.1/imaputil.c 2004-11-23 10:17:39.000000000 +0100
+++ /tmp/dpep.cZz5za/dbmail-2.0.1/imaputil.c 2004-11-23 10:41:55.000000000
+0100
@@ -2663,9 +2663,12 @@
return 0; /* no search */
newset = (int *) my_malloc(sizeof(int) * setlen);
+
if (!newset)
return -2;
+ memset(newset,'\0', sizeof(newset));
+
switch (sk->type) {
case IST_SET:
build_set(rset, setlen, sk->search);
diff -urNad dbmail-2.0.1/list.c /tmp/dpep.cZz5za/dbmail-2.0.1/list.c
--- dbmail-2.0.1/list.c 2004-11-23 10:17:39.000000000 +0100
+++ /tmp/dpep.cZz5za/dbmail-2.0.1/list.c 2004-11-23 10:43:18.000000000
+0100
@@ -81,6 +81,16 @@
return newstart;
}
+/*
+ * return a empty initialized element;
+ */
+static struct element *element_new(void)
+{
+ struct element *new = (struct element *)my_malloc(sizeof(struct
element));
+ if (new != NULL)
+ memset(new,'\0',sizeof(struct element));
+ return new;
+}
/*
* list_nodeadd()
@@ -94,36 +104,21 @@
size_t dsize)
{
struct element *p;
-
+
if (!tlist)
return NULL; /* cannot add to non-existing list */
- p = tlist->start;
-
- tlist->start =
- (struct element *) my_malloc(sizeof(struct element));
-
- /* allocating memory */
-#ifdef USE_EXIT_ON_ERROR
- memtst(tlist->start == NULL);
- memtst((tlist->start->data = (void *) my_malloc(dsize)) == NULL);
-#else
- if (!tlist->start)
+ if (! (p = element_new()))
return NULL;
- tlist->start->data = (void *) my_malloc(dsize);
- if (!tlist->start->data) {
- my_free(tlist->start);
- tlist->start = NULL;
+ if (! (p->data = (void *)my_malloc(dsize))) {
+ my_free(p);
return NULL;
}
-#endif
-
- /* copy data */
- tlist->start->data = memcpy(tlist->start->data, data, dsize);
- tlist->start->dsize = dsize;
-
- tlist->start->nextnode = p;
+ p->data = memcpy(p->data, data, dsize);
+ p->dsize=dsize;
+ p->nextnode=tlist->start;
+ tlist->start = p;
/* updating node count */
tlist->total_nodes++;