Parcourir la source

[apt-inst/contrib/arfile.cc] use sizeof instead strlen
Patch from Marius Vollmer, thanks! (Closes: #504325)

David Kalnischkies il y a 17 ans
Parent
commit
472e2c3aa9
2 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 1 1
      apt-inst/contrib/arfile.cc
  2. 2 0
      debian/changelog

+ 1 - 1
apt-inst/contrib/arfile.cc

@@ -96,7 +96,7 @@ bool ARArchive::LoadHeaders()
 	 char S[300];
 	 unsigned long Len;
 	 if (StrToNum(Head.Name+3,Len,sizeof(Head.Size)-3) == false ||
-	     Len >= strlen(S))
+	     Len >= sizeof(S))
 	 {
 	    delete Memb;
 	    return _error->Error(_("Invalid archive member header"));

+ 2 - 0
debian/changelog

@@ -11,6 +11,8 @@ apt (0.7.22.3) unstable; urgency=low
       (by Luca Bruno, Closes: #223712)
   * doc/apt.conf.5.xml:
     - mention the apt.conf.d dir (by Vincent McIntyre, Closes: #520831)
+  * apt-inst/contrib/arfile.cc:
+    - use sizeof instead strlen (by Marius Vollmer, Closes: #504325)
 
   [ George Danchev ]
   * cmdline/apt-cache.cc: