diff options
author | lookup69 <lookup69@gmail.com> | 2013-11-20 15:40:11 +0800 |
---|---|---|
committer | Jonathan Marshall <jmarshall@xbmc.org> | 2013-12-21 17:56:09 +1300 |
commit | 1e0e02eaac8480fd985cb2f9267e433d8c16441c (patch) | |
tree | db1a686358510897fa6a8213088f625e44d052f7 /lib/libexif | |
parent | e5c9656ac8b28954cfda4cd3fa9fe0dff20a78d6 (diff) |
fixed: Incorrect length calculation for keywords from IPTC tags in which could result in a buffer overflow.
Diffstat (limited to 'lib/libexif')
-rw-r--r-- | lib/libexif/IptcParse.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libexif/IptcParse.cpp b/lib/libexif/IptcParse.cpp index 1fc7dfb4a9..a0bba1632e 100644 --- a/lib/libexif/IptcParse.cpp +++ b/lib/libexif/IptcParse.cpp @@ -201,8 +201,10 @@ bool CIptcParse::Process (const unsigned char* const Data, const unsigned short // there may be multiple keywords - lets join them size_t maxLen = MAX_IPTC_STRING - strlen(tag); if (maxLen > 2) + { strcat(tag, ", "); - strncat(tag, pos, min(length, MAX_IPTC_STRING - maxLen - 3)); + strncat(tag, pos, min(length, maxLen - 3)); + } } /* if (id == SLIDE_IPTC_CAPTION) { |