]> git.saurik.com Git - apt.git/commitdiff
set char-limits for the scanf parsing previous crash-reports
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 4 Mar 2012 23:25:32 +0000 (00:25 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 4 Mar 2012 23:25:32 +0000 (00:25 +0100)
apt-pkg/deb/dpkgpm.cc

index 46913263446a2d6bf2de04f0a33b5e2ee4bb028c..c46a812095cd17e97ce3e24aa6f5cb6af4790d50 100644 (file)
@@ -1542,7 +1542,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
         if(strstr(strbuf,"Package:") == strbuf)
         {
            char pkgname[255], version[255];
-           if(sscanf(strbuf, "Package: %s %s", pkgname, version) == 2)
+           if(sscanf(strbuf, "Package: %254s %254s", pkgname, version) == 2)
               if(strcmp(pkgver.c_str(), version) == 0)
               {
                  fclose(report);