[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#89152: apt: Undefined behaviour while using SPtr<> for new[]



Package: apt
Version: 0.5.3
Severity: grave

hi,

while analysing the the latest CVS sources of APT for my project
I found a typo in apt-pkg/policy.cc that can lead to SEGV or at
least memory leaks. Here is a patch that fix it :

--- apt-pkg/policy.cc.orig	Sat Mar 10 15:29:56 2001
+++ apt-pkg/policy.cc	Sat Mar 10 15:30:10 2001
@@ -73,7 +73,7 @@
    }
 
    // Apply the defaults..
-   SPtr<bool> Fixed = new bool[Cache->HeaderP->PackageFileCount];
+   SPtrArray<bool> Fixed = new bool[Cache->HeaderP->PackageFileCount];
    memset(Fixed,0,sizeof(*Fixed)*Cache->HeaderP->PackageFileCount);
    signed Cur = 989;
    StatusOverride = false;

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux mars 2.4.2 #1 Fri Feb 23 20:19:00 CET 2001 i686 unknown

Versions of the packages apt depends on:
ii  libc6          2.2.2-1        GNU C Library: Shared libraries and Timezone
ii  libstdc++2.10- 2.95.3-6       The GNU stdc++ library



Reply to: