summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-05-03 19:15:01 +0200
committerGuillem Jover <guillem@debian.org>2016-05-03 20:01:08 +0200
commit776bbabb4533d9d48c6356744839e10338ace2b8 (patch)
tree7417274f3c0a78fee54239ad1b5542f63949e559 /src
parent4b5023759c9ed35581e3174c6fce09ac8be8589f (diff)
downloaddpkg-776bbabb4533d9d48c6356744839e10338ace2b8.tar.gz
dpkg: Fix off-by-one array allocation
We need two entries more than the current nfiles, one for the next one and one for the final NULL.
Diffstat (limited to 'src')
-rw-r--r--src/archives.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/archives.c b/src/archives.c
index 44753bd27..fa64d0cd5 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -1482,7 +1482,7 @@ archivefiles(const char *const *argv)
if (strcmp(nodename + strlen(nodename) - 4, ".deb") != 0)
continue;
- arglist = m_realloc(arglist, sizeof(char *) * (nfiles + 1));
+ arglist = m_realloc(arglist, sizeof(char *) * (nfiles + 2));
arglist[nfiles++] = m_strdup(nodename);
}