projects
/
profile
/
ivi
/
common-api-runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14b1aa5
)
Fix seg fault on null pointer in operators
author
Johannes Schanda
<schanda@itestra.de>
Fri, 13 Sep 2013 15:24:29 +0000
(17:24 +0200)
committer
Johannes Schanda
<schanda@itestra.de>
Fri, 13 Sep 2013 16:20:59 +0000
(18:20 +0200)
src/CommonAPI/ContainerUtils.cpp
patch
|
blob
|
history
diff --git
a/src/CommonAPI/ContainerUtils.cpp
b/src/CommonAPI/ContainerUtils.cpp
index
bb1a360
..
cfe6914
100644
(file)
--- a/
src/CommonAPI/ContainerUtils.cpp
+++ b/
src/CommonAPI/ContainerUtils.cpp
@@
-11,11
+11,19
@@
namespace CommonAPI {
size_t SharedPointerClientIdContentHash::operator()(const std::shared_ptr<ClientId>& t) const {
- return t->hashCode();
+ if (t) {
+ return t->hashCode();
+ } else {
+ return NULL;
+ }
}
bool SharedPointerClientIdContentEqual::operator()(const std::shared_ptr<ClientId>& a, const std::shared_ptr<ClientId>& b) const {
- return *a==*b;
+ if (a && b) {
+ return *a==*b;
+ } else {
+ return false;
+ }
}
} // namespace std