diff options
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; |