On Thu, Jan 29, 2009 at 07:54:24AM -0800, Daniel Burrows <[email protected]>
was heard to say:
> On Thu, Jan 29, 2009 at 11:25:12AM +0100, Enrico Tassi
> <[email protected]> was heard to say:
> > #6 0x00000000005ecccc in
> > aptitude::apt::download_changelog_manager::prepare (
> > this=0x2023fc0, progress=<value optimized out>,
> > acqlog=<value optimized out>, signallog=<value optimized out>)
> > at pkg_changelog.cc:229
>
> OK, I can only see one way that this line can crash. I don't think
> it should be happening, but I'll add the check in the attached patch to
> defend against it.
That attached patch.
Daniel
diff -r 2aae754dff16 src/generic/apt/pkg_changelog.cc
--- a/src/generic/apt/pkg_changelog.cc Wed Jan 28 09:36:38 2009 -0800
+++ b/src/generic/apt/pkg_changelog.cc Thu Jan 29 07:52:39 2009 -0800
@@ -1,6 +1,6 @@
// pkg_changelog.cc
//
-// Copyright 2000, 2004-2005, 2008 Daniel Burrows
+// Copyright 2000, 2004-2005, 2008-2009 Daniel Burrows
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -227,7 +227,7 @@
if(source_rec != NULL)
for(const char **binaryIt = source_rec->Binaries();
- *binaryIt != NULL; ++binaryIt)
+ binaryIt != NULL && *binaryIt != NULL; ++binaryIt)
{
pkgCache::PkgIterator pkg = (*apt_cache_file)->FindPkg(*binaryIt);
if(!pkg.end() &&