Fix invalid dereference on logging
cppcheck found a case which dereferences an invalid iterator like
```
http/logging.hpp:74:12: warning: Either the condition 'it!=mapping.end()' is redundant or there is possible dereference of an invalid iterator: it. [derefInvalidIteratorRedundantCheck]
return it->second;
http/logging.hpp:69:12: note: Assuming that condition 'it!=mapping.end()' is not redundant
if (it != mapping.end())
^
http/logging.hpp:74:12: note: Dereference of an invalid iterator
return it->second;
^
```
Tested:
- Tries a various bmcweb loglevel.
Change-Id: Ieca8c5c5ee83f0b45a82c3d7e4f19b09bf1422e6
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/http/logging.hpp b/http/logging.hpp
index ed82eb0..5ce9470 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -66,7 +66,7 @@
});
// Unknown log level. Just assume debug
- if (it != mapping.end())
+ if (it == mapping.end())
{
return 6;
}