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
devs/captainigloo/eglfs
Vivek Ellur 7 years ago committed by Mike Blumenkrantz
parent bd0c590489
commit f026fdf9b3
  1. 8
      src/bin/e_font.c

@ -159,7 +159,7 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con
s1 = strchr(font, ':');
if (s1)
{
char *s2, *name, *style;
char *s2, *name, *style, *temp;
int len;
len = s1 - font;
@ -171,7 +171,13 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con
if (s2)
{
len = s2 - name;
temp = name;
name = realloc(name, sizeof(char) * len + 1);
if (!name)
{
free(temp);
return NULL;
}
memset(name, 0, sizeof(char) * len + 1);
strncpy(name, font, len);
}

Loading…
Cancel
Save