Bugfixes
* libproto/imap/tag.c: Initialize allocated slot to 0 * mu/imap.c: Fix number of elements to allocate
Showing
2 changed files
with
3 additions
and
1 deletions
... | @@ -40,6 +40,8 @@ _mu_imap_tag_incr (mu_imap_t imap) | ... | @@ -40,6 +40,8 @@ _mu_imap_tag_incr (mu_imap_t imap) |
40 | if (!np) | 40 | if (!np) |
41 | return ENOMEM; | 41 | return ENOMEM; |
42 | imap->tag_buf = np; | 42 | imap->tag_buf = np; |
43 | imap->tag_buf[imap->tag_len] = 0; | ||
44 | |||
43 | sp = realloc (imap->tag_str, | 45 | sp = realloc (imap->tag_str, |
44 | (imap->tag_len + 2) * sizeof imap->tag_str[0]); | 46 | (imap->tag_len + 2) * sizeof imap->tag_str[0]); |
45 | if (!sp) | 47 | if (!sp) | ... | ... |
... | @@ -588,7 +588,7 @@ com_connect (int argc, char **argv) | ... | @@ -588,7 +588,7 @@ com_connect (int argc, char **argv) |
588 | if (!status) | 588 | if (!status) |
589 | { | 589 | { |
590 | connect_argc = argc; | 590 | connect_argc = argc; |
591 | connect_argv = mu_calloc (argc, sizeof (*connect_argv)); | 591 | connect_argv = mu_calloc (argc + 1, sizeof (*connect_argv)); |
592 | for (i = 0; i < argc; i++) | 592 | for (i = 0; i < argc; i++) |
593 | connect_argv[i] = mu_strdup (argv[i]); | 593 | connect_argv[i] = mu_strdup (argv[i]); |
594 | connect_argv[i] = NULL; | 594 | connect_argv[i] = NULL; | ... | ... |
-
Please register or sign in to post a comment