From 1ab883b9725c2ecb5d30e938bdd5347ef788be12 Mon Sep 17 00:00:00 2001 From: Myna V Date: Sat, 2 Sep 2017 14:04:37 +0530 Subject: [PATCH] Added sanity checks in ECUtil::decode for input repair buffer sizes before it asserts for non-zeros size. Authors: Myna, Elita. Signed-off-by: Myna Vajha --- src/osd/ECUtil.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osd/ECUtil.cc b/src/osd/ECUtil.cc index d7a64e4e1808e..c7ce7b3042cb5 100644 --- a/src/osd/ECUtil.cc +++ b/src/osd/ECUtil.cc @@ -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 need; for (map::iterator i = out.begin(); i != out.end(); -- 2.39.5