aboutsummaryrefslogtreecommitdiff
path: root/lib/libexif
diff options
context:
space:
mode:
authorlookup69 <lookup69@gmail.com>2013-11-20 15:40:11 +0800
committerJonathan Marshall <jmarshall@xbmc.org>2013-12-21 17:56:09 +1300
commit1e0e02eaac8480fd985cb2f9267e433d8c16441c (patch)
treedb1a686358510897fa6a8213088f625e44d052f7 /lib/libexif
parente5c9656ac8b28954cfda4cd3fa9fe0dff20a78d6 (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.cpp4
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)
{