summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-11-10 12:26:14 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-10 12:26:14 -0500
commitf026fdf9b345837d1145f657b2c8ef04765acc60 (patch)
tree97ad0d8ecd8e900a313b3905e65066eeb9fb67a3
parentbd0c590489a7ae1c3185578389f19bde4bacbcff (diff)
e: Fix realloc issue in e font module
Summary: @Fix Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3306
-rw-r--r--src/bin/e_font.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/e_font.c b/src/bin/e_font.c
index e1f4e743a..81423aca6 100644
--- a/src/bin/e_font.c
+++ b/src/bin/e_font.c
@@ -159,7 +159,7 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con
159 s1 = strchr(font, ':'); 159 s1 = strchr(font, ':');
160 if (s1) 160 if (s1)
161 { 161 {
162 char *s2, *name, *style; 162 char *s2, *name, *style, *temp;
163 int len; 163 int len;
164 164
165 len = s1 - font; 165 len = s1 - font;
@@ -171,7 +171,13 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con
171 if (s2) 171 if (s2)
172 { 172 {
173 len = s2 - name; 173 len = s2 - name;
174 temp = name;
174 name = realloc(name, sizeof(char) * len + 1); 175 name = realloc(name, sizeof(char) * len + 1);
176 if (!name)
177 {
178 free(temp);
179 return NULL;
180 }
175 memset(name, 0, sizeof(char) * len + 1); 181 memset(name, 0, sizeof(char) * len + 1);
176 strncpy(name, font, len); 182 strncpy(name, font, len);
177 } 183 }