summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-05 10:43:25 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-05 10:45:29 +0200
commita76633b930499ee9d7d47d6b438d5e0d2f780eea (patch)
tree75d8517d7c83b214617ceb48c4e6d85f4c96a836 /src/lib/efreet
parent92437d72048878f7712fc536cc6ba31bd77cb5c0 (diff)
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.
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_xml.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/efreet/efreet_xml.c b/src/lib/efreet/efreet_xml.c
index fbf14d78c2..9ec2c721e1 100644
--- a/src/lib/efreet/efreet_xml.c
+++ b/src/lib/efreet/efreet_xml.c
@@ -333,9 +333,10 @@ static void
333efreet_xml_attributes_parse(char **data, int *size, 333efreet_xml_attributes_parse(char **data, int *size,
334 Efreet_Xml_Attribute ***attributes, int *error) 334 Efreet_Xml_Attribute ***attributes, int *error)
335{ 335{
336 Efreet_Xml_Attribute attr[10]; 336 Efreet_Xml_Attribute attr[11];
337 int i, count = 0; 337 int i, count = 0;
338 338
339 memset(attr, sizeof(attr), 0);
339 while (*size > 0) 340 while (*size > 0)
340 { 341 {
341 if (**data == '>') 342 if (**data == '>')
@@ -351,9 +352,6 @@ efreet_xml_attributes_parse(char **data, int *size,
351 char buf[256]; 352 char buf[256];
352 int buf_size; 353 int buf_size;
353 354
354 attr[count].key = NULL;
355 attr[count].value = NULL;
356
357 start = *data; 355 start = *data;
358 while ((*size > 0) && ((isalpha(**data)) || (**data == '_'))) 356 while ((*size > 0) && ((isalpha(**data)) || (**data == '_')))
359 { 357 {