forked from enlightenment/efl
efreet: Fix allocated data size
Since we check for count < 10 and then add 1, we could get count == 11. Also set array memory to 0 in one command.
This commit is contained in:
parent
92437d7204
commit
a76633b930
|
@ -333,9 +333,10 @@ static void
|
|||
efreet_xml_attributes_parse(char **data, int *size,
|
||||
Efreet_Xml_Attribute ***attributes, int *error)
|
||||
{
|
||||
Efreet_Xml_Attribute attr[10];
|
||||
Efreet_Xml_Attribute attr[11];
|
||||
int i, count = 0;
|
||||
|
||||
memset(attr, sizeof(attr), 0);
|
||||
while (*size > 0)
|
||||
{
|
||||
if (**data == '>')
|
||||
|
@ -351,9 +352,6 @@ efreet_xml_attributes_parse(char **data, int *size,
|
|||
char buf[256];
|
||||
int buf_size;
|
||||
|
||||
attr[count].key = NULL;
|
||||
attr[count].value = NULL;
|
||||
|
||||
start = *data;
|
||||
while ((*size > 0) && ((isalpha(**data)) || (**data == '_')))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue