Menu

#34 Patch buffer overrun revealed by FORTIFY_SOURCE

Unstable_(example)
open
nobody
None
1
2025-05-21
2025-05-21
No

During a build of giflib, the below issue was reported at build time. Attached patch should fix the issue based on compiler hints.

giflib: Patch buffer overrun revealed by FORTIFY_SOURCE

--- a/giftext.c 2025-01-09 20:54:01.061791223 +0000
+++ b/giftext.c 2025-01-09 21:04:39.525735979 +0000
@@ -418,7 +418,7 @@
 static void PrintExtBlock(GifByteType *Extension, bool Reset) {
              static int CrntPlace = 0;
              static long ExtCount = 0;
-             static char HexForm[49], AsciiForm[17];
+             static char HexForm[49], AsciiForm[18];

              if (Reset || Extension == NULL) {
                       if (Extension == NULL) {
@@ -464,7 +464,7 @@
 static void PrintPixelBlock(GifByteType *PixelBlock, int Len, bool Reset) {
              static int CrntPlace = 0;
              static long ExtCount = 0;
-             static char HexForm[49], AsciiForm[17];
+             static char HexForm[49], AsciiForm[18];
              int i;

              if (Reset || PixelBlock == NULL) {

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.