englebass pushed a commit to branch master.
commit a76633b930499ee9d7d47d6b438d5e0d2f780eea
Author: Sebastian Dransfeld <[email protected]>
Date: Mon Aug 5 10:43:25 2013 +0200
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.
---
src/lib/efreet/efreet_xml.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/lib/efreet/efreet_xml.c b/src/lib/efreet/efreet_xml.c
index fbf14d7..9ec2c72 100644
--- a/src/lib/efreet/efreet_xml.c
+++ b/src/lib/efreet/efreet_xml.c
@@ -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 == '_')))
{
--
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk