- dont crash on packages with no files
authorpmatilai <pmatilai>
Sat, 27 May 2006 10:58:42 +0000 (10:58 +0000)
committerpmatilai <pmatilai>
Sat, 27 May 2006 10:58:42 +0000 (10:58 +0000)
apt-pkg/rpm/rpmhandler.cc

index 6aa3033..2784a08 100644 (file)
@@ -112,6 +112,9 @@ bool RPMHandler::HasFile(const char *File)
    int_32 count = 0;
    rpmHeaderGetEntry(HeaderP, RPMTAG_OLDFILENAMES,
                      NULL, (void **) &val, &count);
+   if (count < 1)
+      return false;
+
    names = (char **)val;
    while (count--)
    {