Skip to content

Commit

Permalink
fixed: Incorrect length calculation for keywords from IPTC tags in wh…
Browse files Browse the repository at this point in the history
…ich could result in a buffer overflow.
  • Loading branch information
lookup69 authored and Jonathan Marshall committed Dec 21, 2013
1 parent e5c9656 commit 1e0e02e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/libexif/IptcParse.cpp
Expand Up @@ -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)
{
Expand Down

0 comments on commit 1e0e02e

Please sign in to comment.