Fix SetValue check condition 92/240292/1
authorChanggyu Choi <changyu.choi@samsung.com>
Wed, 5 Aug 2020 05:57:59 +0000 (14:57 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Wed, 5 Aug 2020 05:58:10 +0000 (14:58 +0900)
Change-Id: I7c5cfe6ee5ae6ea3150a61ade36b875929aa6442
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/key-info-internal.cc

index eb0b559..8dd56cd 100644 (file)
@@ -359,7 +359,7 @@ int KeyInfo::Decode(const std::vector<unsigned char>& bytes) {
 }
 
 int KeyInfo::SetValue(int index, const std::vector<unsigned char>& value) {
-  if (index > GetSize() && index < 0)
+  if (index > GetSize() || index < 0)
     return BUNDLE_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS;
 
   if (!IsArray())