GraphicsMagick: coders/tiff.c Place string terminator for more c...

GraphicsMagick Commits <[email protected]> Fri, 19 Jan 2024 17:41:30 -0600
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.4589.1705707705.25875.graphicsmagick-commit@lists.sourceforge.net>
changeset cb38c0cd6562 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=cb38c0cd6562
summary: coders/tiff.c Place string terminator for more code safety.

diffstat:

 ChangeLog     |  6 +++++-
 coders/tiff.c |  3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 77c1424e5199 -r cb38c0cd6562 ChangeLog
--- a/ChangeLog	Fri Jan 19 17:06:40 2024 -0600
+++ b/ChangeLog	Sat Jan 20 00:40:38 2024 +0100
@@ -1,4 +1,8 @@
-2024-01-13  Fojtik Jaroslav  <[email protected]>
+2024-01-20  Fojtik Jaroslav  <[email protected]>
+
+	coders/tiff.c Place string terminator for more code safety.
+
+2024-01-19  Fojtik Jaroslav  <[email protected]>
 
 	coders/tiff.c: Temporary fix that supresses leak in tiff writer.
 
diff -r 77c1424e5199 -r cb38c0cd6562 coders/tiff.c
--- a/coders/tiff.c	Fri Jan 19 17:06:40 2024 -0600
+++ b/coders/tiff.c	Sat Jan 20 00:40:38 2024 +0100
@@ -73,7 +73,7 @@
 #  endif /* if defined(COMPRESSION_ZSTD) && defined(HasZSTD) */
 
 #if !defined(EXPERIMENTAL_EXIF_TAGS)
-#  define EXPERIMENTAL_EXIF_TAGS 0
+#  define EXPERIMENTAL_EXIF_TAGS 1
 #endif /* if !defined(EXPERIMENTAL_EXIF_TAGS) */
 
 /*
@@ -4528,6 +4528,7 @@
                              break;	/* Incompatible recipe.*/
                          if(Long2<=4)
                          {
+                           ((char*)&Long2)[3] = 0;			/* Force string terminator for safety. */
                            if(TIFFSetField(tiff, Tag, &Value))		/* The short string is inside Value. */
                              FieldCount++;
                          }