(mh_context_read): Avoid writing past blurb end.
Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -116,13 +116,13 @@ mh_context_read (mh_context_t *ctx) | ... | @@ -116,13 +116,13 @@ mh_context_read (mh_context_t *ctx) |
116 | if (!*q || *q == '#') | 116 | if (!*q || *q == '#') |
117 | continue; | 117 | continue; |
118 | 118 | ||
119 | while ((*p = *q++)) | 119 | while (*q) |
120 | p++; | 120 | *p++ = *q++; |
121 | } | 121 | } |
122 | fclose (fp); | 122 | fclose (fp); |
123 | 123 | ||
124 | if ((status = mu_header_create (&ctx->header, blurb, p - blurb, NULL)) != 0) | 124 | status = mu_header_create (&ctx->header, blurb, p - blurb, NULL); |
125 | free (blurb); | 125 | free (blurb); |
126 | 126 | ||
127 | return status; | 127 | return status; |
128 | } | 128 | } | ... | ... |
-
Please register or sign in to post a comment