aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorace20022 <ace20022@xbmc.org>2015-07-10 16:09:09 +0200
committerace20022 <ace20022@xbmc.org>2015-07-10 16:33:54 +0200
commit39cb6232250c2e99f165f34caf7c747c0e3c5f5f (patch)
tree6d70a9e195214ec3729689b5a6b5d47b1a11643d /lib
parent5172b7e6c09d309b1d1e9ae0b95bd41eef6b7495 (diff)
[fix][libexif] Prevent possible buffer overrun for XP comments.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/libexif/ExifParse.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp
index d651fb16d8..7e4482e933 100755
--- a/lib/libexif/ExifParse.cpp
+++ b/lib/libexif/ExifParse.cpp
@@ -485,8 +485,8 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart,
{
// The XP user comment field is always unicode (UCS-2) encoded
m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_UNICODE;
-
- memcpy(m_ExifInfo->Comments, ValuePtr, ByteCount);
+ size_t length = min(ByteCount, MAX_COMMENT);
+ memcpy(m_ExifInfo->Comments, ValuePtr, length);
}
break;