texlive[48980] Build/source/texk: avoid possible strlen on null ptr
commits+karl at tug.org
commits+karl at tug.org
Wed Oct 24 00:43:58 CEST 2018
Revision: 48980
http://tug.org/svn/texlive?view=revision&revision=48980
Author: karl
Date: 2018-10-24 00:43:58 +0200 (Wed, 24 Oct 2018)
Log Message:
-----------
avoid possible strlen on null ptr
Modified Paths:
--------------
trunk/Build/source/texk/dvipsk/ChangeLog
trunk/Build/source/texk/dvipsk/writet1.c
trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
trunk/Build/source/texk/web2c/pdftexdir/writet1.c
Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog 2018-10-23 20:45:07 UTC (rev 48979)
+++ trunk/Build/source/texk/dvipsk/ChangeLog 2018-10-23 22:43:58 UTC (rev 48980)
@@ -1,3 +1,9 @@
+2018-10-24 Karl Berry <karl at tug.org>
+
+ * writet1.c (t1_check_unusual_charstring): don't call
+ strlen(t1_buf_array) if it is null.
+ From Luigi, 22 Oct 2018 22:43:03.
+
2018-09-18 Nick Roessler <nicholas.e.roessler at gmail.com>
* writet1.c (t1_check_unusual_charstring): protect against buffer
Modified: trunk/Build/source/texk/dvipsk/writet1.c
===================================================================
--- trunk/Build/source/texk/dvipsk/writet1.c 2018-10-23 20:45:07 UTC (rev 48979)
+++ trunk/Build/source/texk/dvipsk/writet1.c 2018-10-23 22:43:58 UTC (rev 48980)
@@ -1,5 +1,5 @@
/*
-Copyright 1996-2013 Han The Thanh <thanh at pdftex.org>
+Copyright 1996-2018 Han The Thanh <thanh at pdftex.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1449,7 +1449,9 @@
*(strend(t1_buf_array) - 1) = ' ';
t1_getline();
- alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
+ alloc_array(t1_buf, strlen(t1_line_array)
+ + (t1_buf_array ? strlen(t1_buf_array) + 1 : 0),
+ T1_BUF_SIZE);
strcat(t1_buf_array, t1_line_array);
alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
strcpy(t1_line_array, t1_buf_array);
Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2018-10-23 20:45:07 UTC (rev 48979)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2018-10-23 22:43:58 UTC (rev 48980)
@@ -1,3 +1,9 @@
+2018-10-24 Karl Berry <karl at tug.org>
+
+ * writet1.c (t1_check_unusual_charstring): don't call
+ strlen(t1_buf_array) if it is null.
+ From Luigi, 22 Oct 2018 22:43:03.
+
2018-10-22 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
* pdftosrc-newpoppler.cc: Add a comment that it works upto
Modified: trunk/Build/source/texk/web2c/pdftexdir/writet1.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/writet1.c 2018-10-23 20:45:07 UTC (rev 48979)
+++ trunk/Build/source/texk/web2c/pdftexdir/writet1.c 2018-10-23 22:43:58 UTC (rev 48980)
@@ -1,5 +1,5 @@
/*
-Copyright 1996-2014 Han The Thanh <thanh at pdftex.org>
+Copyright 1996-2018 Han The Thanh <thanh at pdftex.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1598,7 +1598,9 @@
*(strend(t1_buf_array) - 1) = ' ';
t1_getline();
- alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
+ alloc_array(t1_buf, strlen(t1_line_array)
+ + (t1_buf_array ? strlen(t1_buf_array) + 1 : 0),
+ T1_BUF_SIZE);
strcat(t1_buf_array, t1_line_array);
alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
strcpy(t1_line_array, t1_buf_array);
More information about the tex-live-commits
mailing list