]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix overflow assert check
authorSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 00:53:29 +0000 (17:53 -0700)
committerSage Weil <sage@inktank.com>
Sat, 29 Sep 2012 00:53:29 +0000 (17:53 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/librbd/internal.cc

index 9176ec9198f610ed4c316b50d16712077088809f..017102f2d7f37346952fbf2b8ec4304f5c62842a 100644 (file)
@@ -142,7 +142,7 @@ namespace librbd {
     uint64_t num, offset;
     iss >> std::hex >> num;
     uint64_t block_size = 1ULL << order;
-    assert(num > (ULLONG_MAX / block_size));
+    assert(num <= (ULLONG_MAX / block_size));
     offset = num * block_size;
     return offset;
   }