[Reproducible-commits] [dpkg] 06/17: libcompat: Do not NULL-terminate the list in scandir()
Holger Levsen
holger at layer-acht.org
Tue May 3 08:43:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to annotated tag 1.16.13
in repository dpkg.
commit 26923ff3f9f5e3ed7307746705ad1f76c23804fa
Author: Guillem Jover <guillem at debian.org>
Date: Sat Oct 26 04:17:44 2013 +0200
libcompat: Do not NULL-terminate the list in scandir()
Cherry picked from commit f470bfb33f0b2d5cf20c2c533e0ccfb2145bbc5c.
This might cause a segfault in case all entries have been filtered and
list has not been allocated. This should only possibly affect systems
where the fallback code is being used.
---
debian/changelog | 4 ++++
lib/compat/scandir.c | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index a590691..53a6c8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
dpkg (1.16.13) UNRELEASED; urgency=low
+ [ Guillem Jover ]
+ * Do not NULL-terminate the list in the compat scandir(), as this might
+ cause a segfault in case the function returns 0 entries.
+
[ Updated scripts translations ]
* Fix a typo in the German scripts translation.
diff --git a/lib/compat/scandir.c b/lib/compat/scandir.c
index 35551fc..c38ae01 100644
--- a/lib/compat/scandir.c
+++ b/lib/compat/scandir.c
@@ -85,7 +85,6 @@ scandir(const char *dir, struct dirent ***namelist,
list[used] = m;
used++;
}
- list[used] = NULL;
closedir(d);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list