Applied Neil W Rickert <rickert+nmh@cs.niu.edu>'s msh.c patch:
authorDan Harkless <dan@harkless.org>
Mon, 6 Mar 2000 20:19:04 +0000 (20:19 +0000)
committerDan Harkless <dan@harkless.org>
Mon, 6 Mar 2000 20:19:04 +0000 (20:19 +0000)
    I finally tracked down the problem in msh that was causing errors
    whenever I tried to examine a 'mmdf' style mailbox.

    It turns out that not enough memory was being allocated with
    calloc(), causing memory pointers to be overwritten and corrupted.

ChangeLog
uip/msh.c

index 9a29c0f..7aa74d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Mar 06 12:20:20 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
+
+       * Applied Neil W Rickert <rickert+nmh@cs.niu.edu>'s msh.c patch:
+
+             I finally tracked down the problem in msh that was causing errors
+              whenever I tried to examine a 'mmdf' style mailbox.
+
+             It turns out that not enough memory was being allocated with
+              calloc(), causing memory pointers to be overwritten and corrupted.
+               
 Fri Mar 03 16:07:33 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
 
        * Changed the new "plussed_user" option to mts.conf's
 Fri Mar 03 16:07:33 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
 
        * Changed the new "plussed_user" option to mts.conf's
index 2769c24..eeb87a1 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -754,7 +754,7 @@ setup (char *file)
     if (!(mp = (struct msgs  *) calloc ((size_t) 1, sizeof(*mp))))
        padios (NULL, "unable to allocate folder storage");
 
     if (!(mp = (struct msgs  *) calloc ((size_t) 1, sizeof(*mp))))
        padios (NULL, "unable to allocate folder storage");
 
-    if (!(mp->msgstats = calloc ((size_t) 1, msgp + 3)))
+    if (!(mp->msgstats = calloc ((size_t) msgp + 3, sizeof(*(mp->msgstats)))))
        padios (NULL, "unable to allocate message status storage");
 
     mp->hghmsg = msgp;
        padios (NULL, "unable to allocate message status storage");
 
     mp->hghmsg = msgp;