GraphicsMagick: GenerateCineonTimeStamp(): Correct strlcpy() len...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.7423.1691502874.1374.graphicsmagick-commit@lists.sourceforge.net>
changeset c6b81acd69bd in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=c6b81acd69bd
summary: GenerateCineonTimeStamp(): Correct strlcpy() length arguments so they are based on the actual destination buffer size.

diffstat:

 ChangeLog          |   9 +++++++++
 coders/cineon.c    |   6 +++---
 www/Changelog.html |  11 +++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r f42ffbea571e -r c6b81acd69bd ChangeLog
--- a/ChangeLog	Mon Aug 07 14:46:40 2023 -0500
+++ b/ChangeLog	Tue Aug 08 08:54:25 2023 -0500
@@ -1,3 +1,12 @@
+2023-08-08  Bob Friesenhahn  <[email protected]>
+
+	* coders/cineon.c (GenerateCineonTimeStamp): Correct strlcpy()
+	length arguments so they are based on the actual destination
+	buffer size.  Based on a report from Dirk Müller
+	<[email protected]> that the test suite does not pass with the new
+	glibc 2.38 (which finally provides strlcpy()/strlcat()) due to a
+	fortify assertion.
+
 2023-08-08  Fojtik Jaroslav  <[email protected]>
 
 	* coders/bmp.c: CI chunk must have biSize only 12 or 40.
diff -r f42ffbea571e -r c6b81acd69bd coders/cineon.c
--- a/coders/cineon.c	Mon Aug 07 14:46:40 2023 -0500
+++ b/coders/cineon.c	Tue Aug 08 08:54:25 2023 -0500
@@ -1,5 +1,5 @@
 /*
-% Copyright (C) 2003-2021 GraphicsMagick Group
+% Copyright (C) 2003-2023 GraphicsMagick Group
 %
 % This program is covered by multiple licenses, which are described in
 % Copyright.txt. You should have received a copy of Copyright.txt with this
@@ -1136,9 +1136,9 @@
   (void) strftime(timestamp,MaxTextExtent,"%Y:%m:%d:%H:%M:%S%Z",t);
   timestamp[MaxTextExtent-1]='\0';
   (void) memset(date_str,0,date_str_length);
-  (void) strlcpy(date_str,timestamp,11);
+  (void) strlcpy(date_str,timestamp,date_str_length);
   (void) memset(time_str,0,time_str_length);
-  (void) strlcpy(time_str,timestamp+11,15);
+  (void) strlcpy(time_str,timestamp+11,time_str_length);
 }
 
 
diff -r f42ffbea571e -r c6b81acd69bd www/Changelog.html
--- a/www/Changelog.html	Mon Aug 07 14:46:40 2023 -0500
+++ b/www/Changelog.html	Tue Aug 08 08:54:25 2023 -0500
@@ -37,6 +37,17 @@
 </div>
 
 <div class="document">
+<p>2023-08-08  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
+<blockquote>
+<ul class="simple">
+<li><p>coders/cineon.c (GenerateCineonTimeStamp): Correct strlcpy()
+length arguments so they are based on the actual destination
+buffer size.  Based on a report from Dirk Müller
+&lt;<a class="reference external" href="mailto:dmueller&#37;&#52;&#48;suse&#46;de">dmueller<span>&#64;</span>suse<span>&#46;</span>de</a>&gt; that the test suite does not pass with the new
+glibc 2.38 (which finally provides strlcpy()/strlcat()) due to a
+fortify assertion.</p></li>
+</ul>
+</blockquote>
 <p>2023-08-08  Fojtik Jaroslav  &lt;<a class="reference external" href="mailto:JaFojtik&#37;&#52;&#48;yandex&#46;com">JaFojtik<span>&#64;</span>yandex<span>&#46;</span>com</a>&gt;</p>
 <blockquote>
 <ul class="simple">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.