This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=5969fca5b35d8ba4a3f88e2d1a25cd4e9c985a7e

The branch, master has been updated
       via  5969fca5b35d8ba4a3f88e2d1a25cd4e9c985a7e (commit)
      from  4616b75f8a0e1d6fbbff7b20f418bc39c44ee34f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5969fca5b35d8ba4a3f88e2d1a25cd4e9c985a7e
Author: Sergey Poznyakoff <g...@gnu.org.ua>
Date:   Mon Apr 13 10:42:44 2009 +0300

    Bugfix
    
    * libproto/imap/folder.c (imap_list): Fix memory overrun.
    Set response->level.

-----------------------------------------------------------------------

Summary of changes:
 libproto/imap/folder.c |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/libproto/imap/folder.c b/libproto/imap/folder.c
index 2fdda56..85a7ba8 100644
--- a/libproto/imap/folder.c
+++ b/libproto/imap/folder.c
@@ -1402,13 +1402,13 @@ imap_list (f_imap_t f_imap)
   if (f_imap->enum_stop)
     return 0;
       
-  buffer = malloc (len);
+  buffer = malloc (len + 1);
   if (!buffer)
     return ENOMEM;
   memcpy (buffer, f_imap->buffer, len);
   buffer[len] = '\0';
 
-  lr = malloc (sizeof (*lr));
+  lr = calloc (1, sizeof (*lr));
   if (!lr)
     return ENOMEM;
       
@@ -1488,6 +1488,23 @@ imap_list (f_imap_t f_imap)
          if (!lr->name)
            status = ENOMEM;
        }
+      if (lr->separator)
+       {
+         size_t off;
+         char delim[2];
+         size_t n = 0;
+         
+         delim[0] = lr->separator;
+         delim[1] = 0;
+         s = lr->name;
+         while (off = strcspn (s, delim), s[off])
+           {
+             n++;
+             off++;
+             s += off;
+           }
+         lr->level = n;
+       }
     }
   mu_argcv_free (argc, argv);
   free (buffer);


hooks/post-receive
--
GNU Mailutils


_______________________________________________
Commit-mailutils mailing list
Commit-mailutils@gnu.org
http://lists.gnu.org/mailman/listinfo/commit-mailutils

Reply via email to