From 8abdf365f9f1e8d3fd288d2f3ae9178b9800a041 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sat, 24 Aug 2002 19:22:33 +0000 Subject: [PATCH] Fix segfault when --auto-deconfigure is given. This is causes because the deconfigure list is allocated in an obstack, but then freed with normal free(). --- ChangeLog | 6 ++++++ debian/changelog | 1 + main/archives.c | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49b68463..54cee77f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Aug 24 14:16:13 CDT 2002 Adam Heath + + * lib/archives.c: Fix segfault when --auto-deconfigure is given. This is + causes because the deconfigure list is allocated in an obstack, but + then freed with normal free(). + Thu Aug 22 23:37:45 CDT 2002 Adam Heath * lib/database.c, lib/parse.c, lib/parsehelp.c, main/main.c: Fix several diff --git a/debian/changelog b/debian/changelog index 62aa267a..a3363934 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ dpkg (1.10.5) unstable; urgency=low * Handle directories better in md5sum. Closes: #157453. * Fix read past buffer in lib/nfmalloc.c. Closes: #157304. * Fix several read pass buffer bugs, and a memleak. Closes: #155362. + * Fix segfault when --auto-deconfigure is given. Closes: #157762. -- Adam Heath UNRELEASED diff --git a/main/archives.c b/main/archives.c index 18dcb770..c89f9de9 100644 --- a/main/archives.c +++ b/main/archives.c @@ -653,8 +653,7 @@ static int try_remove_can(struct deppossi *pdep, } } pdep->up->up->clientdata->istobe= itb_deconfigure; - ensureobstackinit(); - newdeconf= obstack_alloc(&tar_obs, sizeof(struct packageinlist)); + newdeconf= malloc(sizeof(struct packageinlist)); newdeconf->next= deconfigure; newdeconf->pkg= pdep->up->up; deconfigure= newdeconf; -- 2.39.5