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:
9ed65fe
)
eina_unicode: return NULL if allocation fails
author
Vincent Torri
<vincent.torri@gmail.com>
Tue, 30 Apr 2019 08:23:38 +0000
(09:23 +0100)
committer
Hermet Park
<hermetpark@gmail.com>
Wed, 8 May 2019 04:23:36 +0000
(13:23 +0900)
Reviewers: cedric
Subscribers: #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8785
src/lib/eina/eina_unicode.c
patch
|
blob
|
history
diff --git
a/src/lib/eina/eina_unicode.c
b/src/lib/eina/eina_unicode.c
index
adec87a
..
0bb70ff
100644
(file)
--- a/
src/lib/eina/eina_unicode.c
+++ b/
src/lib/eina/eina_unicode.c
@@
-116,6
+116,9
@@
eina_unicode_strndup(const Eina_Unicode *text, size_t n)
EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
ustr = malloc((n + 1) * sizeof(Eina_Unicode));
+ if (!ustr)
+ return NULL;
+
memcpy(ustr, text, n * sizeof(Eina_Unicode));
ustr[n] = 0;
return ustr;