]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Added sanity checks in ECUtil::decode for input repair buffer sizes before
authorMyna V <mynaramana@gmail.com>
Sat, 2 Sep 2017 08:34:37 +0000 (14:04 +0530)
committerMyna V <mynaramana@gmail.com>
Mon, 30 Oct 2017 02:27:05 +0000 (07:57 +0530)
it asserts for non-zeros size.

Authors: Myna, Elita.

Signed-off-by: Myna Vajha <mynaramana@gmail.com>
src/osd/ECUtil.cc

index d7a64e4e1808e8ed9680908fc40fd814e7848a1f..c7ce7b3042cb54c098b0f2227f260e1afa562bd5 100644 (file)
@@ -52,6 +52,13 @@ int ECUtil::decode(
 
   assert(to_decode.size());
 
+  for (auto i = to_decode.begin();
+       i != to_decode.end();
+       ++i) {
+    if(i->second.length() == 0)
+      return 0;
+  }
+
   set<int> need;
   for (map<int, bufferlist*>::iterator i = out.begin();
        i != out.end();