Source: altermime
Version: 0.3.10-4
Tags: patch

With -Wall turned on:

cc1: warnings being treated as errors
In file included from /usr/include/stdio.h:930:0,
                 from MIME_headers.c:21:
In function 'snprintf',
    inlined from 'MIMEH_parse_contentlocation' at MIME_headers.c:2246:12:
/usr/include/bits/stdio2.h:65:3: error: call to __builtin___snprintf_chk will 
always overflow destination buffer
make[1]: *** [MIME_headers.o] Error 1

This error occurs because we are passing the wrong argument to
snprintf.

The below patch fixes the issue.
---
diff -Nru altermime-0.3.10/debian/patches/15_fix_snprintf.diff 
altermime-0.3.10/debian/patches/15_fix_snprintf.diff
--- altermime-0.3.10/debian/patches/15_fix_snprintf.diff        1969-12-31 
17:00:00.000000000 -0700
+++ altermime-0.3.10/debian/patches/15_fix_snprintf.diff        2010-11-04 
22:43:08.000000000 -0600
@@ -0,0 +1,13 @@
+Index: altermime-0.3.10/MIME_headers.c
+===================================================================
+--- altermime-0.3.10.orig/MIME_headers.c       2010-11-04 22:41:58.891508943 
-0600
++++ altermime-0.3.10/MIME_headers.c    2010-11-04 22:42:58.881921686 -0600
+@@ -2243,7 +2243,7 @@
+               {
+                       if (MIMEH_DNORMAL) 
LOGGER_log("%s:%d:MIME_parse_contentlocation:DEBUG: filename = %s\n", FL, p);
+                       snprintf(hinfo->name, sizeof(hinfo->name),"%s",p);
+-                      snprintf(hinfo->filename, sizeof(hinfo->name),"%s",p);
++                      snprintf(hinfo->filename, 
sizeof(hinfo->filename),"%s",p);
+                       FNFILTER_filter(hinfo->filename, 
_MIMEH_FILENAMELEN_MAX);
+                       SS_push(&(hinfo->ss_filenames), hinfo->filename, 
strlen(hinfo->filename));
+ 
diff -Nru altermime-0.3.10/debian/patches/series 
altermime-0.3.10/debian/patches/series
--- altermime-0.3.10/debian/patches/series      2010-07-26 10:05:51.000000000 
-0600
+++ altermime-0.3.10/debian/patches/series      2010-11-04 22:41:50.000000000 
-0600
@@ -1,3 +1,4 @@
 01_makefile_destdir.diff
 05_makefile_nostrip.diff
 10_fix_printk_warnings.diff
+15_fix_snprintf.diff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to