aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-06-19 23:00:58 -0400
committerMike Frysinger <vapier@gentoo.org>2016-06-19 23:00:58 -0400
commit0091a602c3f8b37b9a8a2948e92b6c7e62beb18a (patch)
tree7f6169e667de5649e3e39cf52b02e9d9a79ed0e0
parentscanelf: enable cleanup for coverity (diff)
downloadpax-utils-0091a602c3f8b37b9a8a2948e92b6c7e62beb18a.tar.gz
pax-utils-0091a602c3f8b37b9a8a2948e92b6c7e62beb18a.tar.bz2
pax-utils-0091a602c3f8b37b9a8a2948e92b6c7e62beb18a.zip
ar: make sure name is always NUL terminated
-rw-r--r--paxinc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/paxinc.c b/paxinc.c
index 64a7f3b..bd13ec4 100644
--- a/paxinc.c
+++ b/paxinc.c
@@ -123,6 +123,7 @@ close_and_ret:
}
snprintf(ret.name, sizeof(ret.name), "%s:%s", ar->filename, s);
+ ret.name[sizeof(ret.name) - 1] = '\0';
if ((s=strchr(ret.name+strlen(ar->filename), '/')) != NULL)
*s = '\0';
ret.date = atoi(ret.buf.formatted.date);