Package: apt
Version: 0.6.41
Severity: normal
Tags: patch

apt-ftparchive segfaults while crawling through dsc files. The attached
patch fixes the problem.

The types of the effected variables changed between 0.5.28 and 0.6.41
from a pointer to a auto_ptr type. The later looses its identity on
copy. So any futher access results in null-pointer dereference.

Bastian

-- 
There is a multi-legged creature crawling on your shoulder.
                -- Spock, "A Taste of Armageddon", stardate 3193.9
diff -ur apt-0.6.41/ftparchive/writer.cc apt-0.6.41.new/ftparchive/writer.cc
--- apt-0.6.41/ftparchive/writer.cc     2005-08-19 08:04:08.000000000 +0000
+++ apt-0.6.41.new/ftparchive/writer.cc 2005-10-19 08:33:24.000000000 +0000
@@ -581,8 +581,6 @@
         auto_ptr<Override::Item> Itm(BOver.GetItem(BinList[I]));
         if (Itm.get() == 0)
            continue;
-        if (OverItem.get() == 0)
-           OverItem = Itm;
 
         unsigned char NewPrioV = debListParser::GetPrio(Itm->Priority);
         if (NewPrioV < BestPrioV || BestPrio.empty() == true)
@@ -590,6 +588,9 @@
            BestPrioV = NewPrioV;
            BestPrio = Itm->Priority;
         }       
+
+        if (OverItem.get() == 0)
+           OverItem = Itm;
       }
    }
    

Attachment: signature.asc
Description: Digital signature

Reply via email to