From 354c87279b6e6a50b066d9f8493fc2e21d00a297 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 30 May 2020 19:19:48 -0600 Subject: [PATCH] libpkgconf: tuple: fix truncation when no overflow occurs --- libpkgconf/tuple.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libpkgconf/tuple.c b/libpkgconf/tuple.c index e445b9f..0d9946d 100644 --- a/libpkgconf/tuple.c +++ b/libpkgconf/tuple.c @@ -274,8 +274,15 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const for (pptr = ptr + 2; *pptr != '\0'; pptr++) { if (*pptr != '}') + { if (vptr < vend) *vptr++ = *pptr; + else + { + *vptr = '\0'; + break; + } + } else { *vptr = '\0';