projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dda07d
)
eina_str: add null check condition in eina_memdup.
author
vivek
<vivek.ellur@samsung.com>
Fri, 20 Feb 2015 10:40:43 +0000
(11:40 +0100)
committer
Cedric BAIL
<cedric@osg.samsung.com>
Fri, 20 Feb 2015 10:42:13 +0000
(11:42 +0100)
Summary:
Added null check in eina_memdup function in eina_str
Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1997
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/eina/eina_str.c
patch
|
blob
|
history
diff --git
a/src/lib/eina/eina_str.c
b/src/lib/eina/eina_str.c
index 770a64404955892c73feac213fb0f3aee40b804f..e1445f21208be963601f9d5c38b2c12709e8d905 100644
(file)
--- a/
src/lib/eina/eina_str.c
+++ b/
src/lib/eina/eina_str.c
@@
-668,8
+668,12
@@
eina_memdup(unsigned char *mem, size_t size, Eina_Bool terminate)
{
unsigned char *ret;
+ if (!mem) return NULL;
+
terminate = !!terminate;
ret = malloc(size + terminate);
+ if (!ret) return NULL;
+
memcpy(ret, mem, size);
if (terminate)
ret[size] = 0;