diff options
-rw-r--r-- | apt-pkg/packagemanager.cc | 1 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 2 | ||||
-rw-r--r-- | methods/gpgv.cc | 12 | ||||
-rw-r--r-- | methods/rred.cc | 7 |
4 files changed, 17 insertions, 5 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index c32c73212..a370f15a3 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -529,7 +529,6 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg) List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States); return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge); - return true; } /*}}}*/ // PM::SmartUnPack - Install helper /*{{{*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 85ae1cd7e..2d0554e21 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1730,7 +1730,7 @@ bool DoAutomaticRemove(CacheFile &Cache) Pkg != tooMuch.end() && Changed == false; ++Pkg) { APT::PackageSet too; - too.insert(Pkg); + too.insert(*Pkg); for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList(); Prv.end() == false; ++Prv) too.insert(Prv.ParentPkg()); diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 2b2aba017..25ba0d063 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -98,8 +98,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, // Read a line. Sigh. while ((c = getc(pipein)) != EOF && c != '\n') { - if (bufferoff == buffersize) - buffer = (char *) realloc(buffer, buffersize *= 2); + if (bufferoff == buffersize) + { + char* newBuffer = (char *) realloc(buffer, buffersize *= 2); + if (newBuffer == NULL) + { + free(buffer); + return "Couldn't allocate a buffer big enough for reading"; + } + buffer = newBuffer; + } *(buffer+bufferoff) = c; bufferoff++; } diff --git a/methods/rred.cc b/methods/rred.cc index e37a12ed9..1e352d0e7 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -333,7 +333,12 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ } if(command_count == command_alloc) { command_alloc = (command_alloc + 64) * 3 / 2; - commands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + EdCommand* newCommands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + if (newCommands == NULL) { + free(commands); + return MMAP_FAILED; + } + commands = newCommands; } commands[command_count++] = cmd; } |