diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-07 01:30:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-07 01:30:09 +0000 |
commit | 847be416dcf2f41c5760a88d4cea2a90f7bd2ebd (patch) | |
tree | a86283aa27bcf6864009999c354b3da0fa83c4ca /Build/source/texk/dvipng/dvipng-src/dvi.c | |
parent | 18c4429cf72d87571e5eb085609186b6dd1f10b9 (diff) |
updated fixes from Jan-Ake from https://savannah.nongnu.org/git/?group=dvipng
git-svn-id: svn://tug.org/texlive/trunk@50835 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipng/dvipng-src/dvi.c')
-rw-r--r-- | Build/source/texk/dvipng/dvipng-src/dvi.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Build/source/texk/dvipng/dvipng-src/dvi.c b/Build/source/texk/dvipng/dvipng-src/dvi.c index 283088d8188..139d0ea13c4 100644 --- a/Build/source/texk/dvipng/dvipng-src/dvi.c +++ b/Build/source/texk/dvipng/dvipng-src/dvi.c @@ -18,7 +18,7 @@ License along with this program. If not, see <http://www.gnu.org/licenses/>. - Copyright (C) 2002-2015 Jan-Åke Larsson + Copyright (C) 2002-2015, 2019 Jan-Åke Larsson ************************************************************************/ @@ -208,12 +208,8 @@ unsigned char* DVIGetCommand(struct dvi_data* dvi) break; } if (strlength > 0) { /* Read string */ - if (strlength == UINT32_MAX - || strlength+1 > UINT32_MAX - (uint32_t)length) { - /* Have to check else we might not realloc buffer. */ - Fatal("strlength %u + 1 + length %u would overflow", - strlength, (uint32_t)length); - } + if (strlength > UINT32_MAX - (uint32_t)length - 1) + Fatal("integer overflow in DVI command length"); if (strlength+1 + (uint32_t)length > commlen) { /* string + command length exceeds that of buffer */ commlen=strlength+1 + (uint32_t)length; |