summaryrefslogtreecommitdiff
path: root/src/stylesheet.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-10-25 02:04:58 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-10-25 02:04:58 +0000
commit1a448101092010efd8f8567bbfc99f2fea7d238e (patch)
tree154a03bdf26e5d3f50f5b02791dfa25260e49ac7 /src/stylesheet.c
parent5caf9a56956f55b70d937cea7e135417bada7b25 (diff)
downloadlibcss-1a448101092010efd8f8567bbfc99f2fea7d238e.tar.gz
libcss-1a448101092010efd8f8567bbfc99f2fea7d238e.tar.bz2
Fix memory corruption. This took far too long to debug. Bah.
svn path=/trunk/libcss/; revision=5628
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r--src/stylesheet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 7608b16..9be6d70 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -535,7 +535,8 @@ css_error css_stylesheet_rule_append_style(css_stylesheet *sheet,
if (cur != NULL) {
/* Already have a style, so append to the end of the bytecode */
css_style *temp = sheet->alloc(cur,
- cur->length + style->length, sheet->pw);
+ sizeof(css_style) + cur->length + style->length,
+ sheet->pw);
if (temp == NULL)
return CSS_NOMEM;