]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: fix bucket type array bound check
authorSage Weil <sage@newdream.net>
Wed, 8 Sep 2010 22:24:29 +0000 (15:24 -0700)
committerSage Weil <sage@newdream.net>
Wed, 8 Sep 2010 22:24:29 +0000 (15:24 -0700)
src/crushtool.cc

index ba4dc57d68d9fbd1539234c0fca66cae976c5cff..44854a25b8dd9a88c66309f591f8f768b73ec137 100644 (file)
@@ -850,7 +850,7 @@ int main(int argc, const char **argv)
       crush.set_type_name(type, l.name);
 
       int buckettype = -1;
-      for (int i = 0; i < (int)sizeof(bucket_types); i++)
+      for (int i = 0; i < (int)(sizeof(bucket_types)/sizeof(bucket_types[0])); i++)
        if (strcmp(l.buckettype, bucket_types[i].name) == 0) {
          buckettype = bucket_types[i].type;
          break;