diff options
author | ace20022 <ace20022@xbmc.org> | 2015-07-10 15:20:41 +0200 |
---|---|---|
committer | ace20022 <ace20022@xbmc.org> | 2015-07-10 16:33:56 +0200 |
commit | 5db13451939e3f4599302ada8eef69e52cda464d (patch) | |
tree | 202187034f2d85851354c04ba9bc102d9f23f98c /lib/libexif/ExifParse.cpp | |
parent | 8a53708fbe75bb6c13708e0d7ee18c7a135fc1ba (diff) |
[fix][libexif] Force text fields to be null-terminated.
Diffstat (limited to 'lib/libexif/ExifParse.cpp')
-rwxr-xr-x | lib/libexif/ExifParse.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp index 7e4482e933..1d4934b84b 100755 --- a/lib/libexif/ExifParse.cpp +++ b/lib/libexif/ExifParse.cpp @@ -420,6 +420,7 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, int length = max(ByteCount, 0); length = min(length, MAX_COMMENT); strncpy(m_ExifInfo->Description, (char *)ValuePtr, length); + m_ExifInfo->Description[length] = '\0'; break; } case TAG_MAKE: strncpy(m_ExifInfo->CameraMake, (char *)ValuePtr, 32); break; @@ -476,6 +477,7 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, int length = ByteCount - EXIF_COMMENT_CHARSET_LENGTH; length = min(length, MAX_COMMENT); memcpy(m_ExifInfo->Comments, ValuePtr + EXIF_COMMENT_CHARSET_LENGTH, length); + m_ExifInfo->Comments[length] = '\0'; // FixComment(comment); // Ensure comment is printable } } @@ -487,6 +489,7 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_UNICODE; size_t length = min(ByteCount, MAX_COMMENT); memcpy(m_ExifInfo->Comments, ValuePtr, length); + m_ExifInfo->Comments[length] = '\0'; } break; |