summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2023-08-25 23:10:40 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2023-08-25 23:10:40 +0000
commit9e08f7eb34e5cdfcc30c12d25f4e9677e3f38843 (patch)
treee9e089386b6eda59d12684ff08882a96b82003dc /Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
parent44d323c1121857a0f7a01e018119ea8e923db84f (diff)
freetype 2.13.2
git-svn-id: svn://tug.org/texlive/trunk@68062 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/base/ftstream.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftstream.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c b/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
index 05c5637578b..64826acebe5 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftstream.c
@@ -141,7 +141,9 @@
if ( read_bytes > count )
read_bytes = count;
- FT_MEM_COPY( buffer, stream->base + pos, read_bytes );
+ /* Allow "reading" zero bytes without UB even if buffer is NULL */
+ if ( count )
+ FT_MEM_COPY( buffer, stream->base + pos, read_bytes );
}
stream->pos = pos + read_bytes;
@@ -178,7 +180,9 @@
if ( read_bytes > count )
read_bytes = count;
- FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );
+ /* Allow "reading" zero bytes without UB even if buffer is NULL */
+ if ( count )
+ FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );
}
stream->pos += read_bytes;