[haiku-commits] r40430 - haiku/trunk/src/kits/package

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2011 20:40:38 +0100 (CET)

Author: zooey
Date: 2011-02-10 20:40:38 +0100 (Thu, 10 Feb 2011)
New Revision: 40430
Changeset: http://dev.haiku-os.org/changeset/40430

Modified:
   haiku/trunk/src/kits/package/RepositoryInfo.cpp
Log:
Disallow the use of 'any' as repository architecture

Modified: haiku/trunk/src/kits/package/RepositoryInfo.cpp
===================================================================
--- haiku/trunk/src/kits/package/RepositoryInfo.cpp     2011-02-10 19:35:40 UTC 
(rev 40429)
+++ haiku/trunk/src/kits/package/RepositoryInfo.cpp     2011-02-10 19:40:38 UTC 
(rev 40430)
@@ -136,6 +136,8 @@
        result = data->FindUInt8(kArchitectureField, (uint8*)&fArchitecture);
        if (result != B_OK)
                return result;
+       if (fArchitecture == B_PACKAGE_ARCHITECTURE_ANY)
+               return B_BAD_DATA;
 
        const char* licenseName;
        const char* licenseText;
@@ -207,7 +209,7 @@
 
        BPackageArchitecture architecture;
        if (BPackageInfo::GetArchitectureByName(architectureString, 
architecture)
-                       != B_OK) {
+                       != B_OK || architecture == B_PACKAGE_ARCHITECTURE_ANY) {
                return B_BAD_DATA;
        }
 


Other related posts:

  • » [haiku-commits] r40430 - haiku/trunk/src/kits/package - zooey