summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ced2e8)
raw | patch | inline | side by side (parent: 6ced2e8)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 20 Mar 2008 10:00:37 +0000 (11:00 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 22 Mar 2008 08:30:27 +0000 (09:30 +0100) |
In cf_read_generic(), the parse result had not been checked to not be
NULL, which caused a segfault when trying to access any of its members.
Now, an error will be returned in that case.
Also, cf_ci_append_children() has been made more robust in that respect.
It now detects an empty source and does nothing in that case.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
NULL, which caused a segfault when trying to access any of its members.
Now, an error will be returned in that case.
Also, cf_ci_append_children() has been made more robust in that respect.
It now detects an empty source and does nothing in that case.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/configfile.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index ce4e7747c95af39aee1f55c9bf1479c2c3917da9..18c82d945a866098ec43016c87364f20da5468cd 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
{
oconfig_item_t *temp;
+ if ((src == NULL) || (src->children_num == 0))
+ return (0);
+
temp = (oconfig_item_t *) realloc (dst->children,
sizeof (oconfig_item_t)
* (dst->children_num + src->children_num));
continue;
}
+ if (temp == NULL) {
+ oconfig_free (root);
+ return (NULL);
+ }
+
cf_ci_append_children (root, temp);
sfree (temp->children);
sfree (temp);