diff options
author | ace20022 <ace20022@xbmc.org> | 2015-07-10 16:09:09 +0200 |
---|---|---|
committer | ace20022 <ace20022@xbmc.org> | 2015-07-10 16:33:54 +0200 |
commit | 39cb6232250c2e99f165f34caf7c747c0e3c5f5f (patch) | |
tree | 6d70a9e195214ec3729689b5a6b5d47b1a11643d | |
parent | 5172b7e6c09d309b1d1e9ae0b95bd41eef6b7495 (diff) |
[fix][libexif] Prevent possible buffer overrun for XP comments.
-rwxr-xr-x | lib/libexif/ExifParse.cpp | 4 |
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; |