summaryrefslogtreecommitdiff
path: root/media-libs/giflib/files/giflib-5.2.2-fortify.patch
blob: 24fc50059aed0bd51a229399d186b392d6b90286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
https://bugs.gentoo.org/848807

Fix incorrect length args to snprintf.

Upstream bug: https://sourceforge.net/p/giflib/bugs/170/

--- a/giftext.c
+++ b/giftext.c
@@ -442,7 +442,7 @@
 		for (i = 1; i <= Len; i++) {
 			(void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x",
 			               Extension[i]);
-			(void)snprintf(&AsciiForm[CrntPlace], 3, "%c",
+			(void)snprintf(&AsciiForm[CrntPlace], 2, "%c",
 			               MAKE_PRINTABLE(Extension[i]));
 			if (++CrntPlace == 16) {
 				HexForm[CrntPlace * 3] = 0;
@@ -488,7 +488,7 @@
 	for (i = 0; i < Len; i++) {
 		(void)snprintf(&HexForm[CrntPlace * 3], 3, " %02x",
 		               PixelBlock[i]);
-		(void)snprintf(&AsciiForm[CrntPlace], 3, "%c",
+		(void)snprintf(&AsciiForm[CrntPlace], 2, "%c",
 		               MAKE_PRINTABLE(PixelBlock[i]));
 		if (++CrntPlace == 16) {
 			HexForm[CrntPlace * 3] = 0;