libpkgconf: tuple: fix truncation when no overflow occurs

master
Ariadne Conill 2020-05-30 19:19:48 -06:00
parent 5eb9cae009
commit 354c87279b
1 changed files with 7 additions and 0 deletions

View File

@ -274,8 +274,15 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const
for (pptr = ptr + 2; *pptr != '\0'; pptr++) for (pptr = ptr + 2; *pptr != '\0'; pptr++)
{ {
if (*pptr != '}') if (*pptr != '}')
{
if (vptr < vend) if (vptr < vend)
*vptr++ = *pptr; *vptr++ = *pptr;
else
{
*vptr = '\0';
break;
}
}
else else
{ {
*vptr = '\0'; *vptr = '\0';