diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-09-26 17:00:27 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-09-26 17:58:07 +0900 |
commit | 0ae529ac196a5b212e2b7386aef9978c4cfa095c (patch) | |
tree | e595a510127504be457b5a2fa8fa02504eb37cc1 /src/lib/eo/eo.c | |
parent | f839905184ef084fad55f3deadd51b405768a49c (diff) |
eo: Fix crashes with call cache after init cycle
It's not enough to check the init generation count, if the cache data is
not reset properly.
This patch adds safety in two ways:
1. Actually reset the op call cache when we detect a new generation
2. Verify that we don't return NULL function pointer
The 1st point is absolutely necessary, 2nd is optional (extra cost of
one if()).
@fix
Diffstat (limited to '')
-rw-r--r-- | src/lib/eo/eo.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index b4bd760b44..f7358db12f 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c | |||
@@ -498,6 +498,7 @@ ok_klass_back: | |||
498 | call->func = func->func; | 498 | call->func = func->func; |
499 | if (is_obj) | 499 | if (is_obj) |
500 | call->data = (char *)obj + cache->off[i].off; | 500 | call->data = (char *)obj + cache->off[i].off; |
501 | if (EINA_UNLIKELY(!call->func)) goto err_cache_op; | ||
501 | return EINA_TRUE; | 502 | return EINA_TRUE; |
502 | } | 503 | } |
503 | } | 504 | } |