Force initialization of buffer (fixes a valgrind case where buf is
authorwwp <wwp@free.fr>
Tue, 8 May 2018 06:54:16 +0000 (08:54 +0200)
committerwwp <wwp@free.fr>
Tue, 8 May 2018 06:54:16 +0000 (08:54 +0200)
used uninitialized).

src/procmime.c

index 44e546c3a930f3e2fef8b5552fdd933041a5030d..2be4b12c792b531e1fc40409c4987c2c00e28095 100644 (file)
@@ -380,11 +380,12 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
        tmp_file = TRUE;
        readend = mimeinfo->offset + mimeinfo->length;
 
+       *buf = '\0';
        if (encoding == ENC_QUOTED_PRINTABLE) {
                while ((ftell(infp) < readend) && (SC_FGETS(buf, sizeof(buf), infp) != NULL)) {
                        gint len;
                        len = qp_decode_line(buf);
-                       buf[len]='\0';
+                       buf[len] = '\0';
                        if (!flowed) {
                                if (SC_FWRITE(buf, 1, len, outfp) < len)
                                        err = TRUE;