diff options
author | Guillem Jover <guillem@debian.org> | 2016-05-03 19:15:01 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-05-03 20:01:08 +0200 |
commit | 776bbabb4533d9d48c6356744839e10338ace2b8 (patch) | |
tree | 7417274f3c0a78fee54239ad1b5542f63949e559 /src | |
parent | 4b5023759c9ed35581e3174c6fce09ac8be8589f (diff) | |
download | dpkg-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.c | 2 |
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); } |