The following commit has been merged in the master branch:
commit b066610b394bfe06b8af5efb0a34c2b56c865705
Author: Guillem Jover <[email protected]>
Date: Sun Feb 21 01:27:55 2010 +0100
dpkg-deb: Fix double free in --info
Change the code to not increase cdlist, and instead index it, so that
we can free it at the end.
Regression introduced in commit c264dd83d33250927fe165de5336145afdf99610.
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index b295718..6aaa55f 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -131,7 +131,7 @@ static void info_list(const char *debar, const char
*directory) {
char interpreter[INTERPRETER_MAX+1], *p;
int il, lines;
struct dirent **cdlist, *cdep;
- int cdn;
+ int cdn, n;
FILE *cc;
struct stat stab;
int c;
@@ -139,8 +139,8 @@ static void info_list(const char *debar, const char
*directory) {
cdn= scandir(".", &cdlist, &ilist_select, alphasort);
if (cdn == -1) ohshite(_("cannot scan directory `%.255s'"),directory);
- while (cdn-- >0) {
- cdep= *cdlist++;
+ for (n = 0; n < cdn; n++) {
+ cdep = cdlist[n];
if (stat(cdep->d_name,&stab))
ohshite(_("cannot stat `%.255s' (in `%.255s')"),cdep->d_name,directory);
if (S_ISREG(stab.st_mode)) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]