diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-11-08 12:06:32 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-11-08 12:06:32 +0000 |
commit | 6189758875b3e8e34fcb3e002a5bbbd7648be754 (patch) | |
tree | aa45344822a9b47776d7e6c97422af97162cafa9 /src/parse/properties | |
parent | a27846b490a4a907872a62e568c412e6d1fc96b6 (diff) | |
download | libcss-6189758875b3e8e34fcb3e002a5bbbd7648be754.tar.gz libcss-6189758875b3e8e34fcb3e002a5bbbd7648be754.tar.bz2 |
Handle css__stylesheet_style_append() returning error. Coverity #1127060.
Diffstat (limited to 'src/parse/properties')
-rw-r--r-- | src/parse/properties/background_position.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/parse/properties/background_position.c b/src/parse/properties/background_position.c index 992372b..d4b31dc 100644 --- a/src/parse/properties/background_position.c +++ b/src/parse/properties/background_position.c @@ -194,12 +194,30 @@ css_error css__parse_background_position(css_language *c, if ((flags & FLAG_INHERIT) == false) { if (value[0] == BACKGROUND_POSITION_HORZ_SET) { - css__stylesheet_style_append(result, length[0]); - css__stylesheet_style_append(result, unit[0]); + error = css__stylesheet_style_append(result, length[0]); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } + + error = css__stylesheet_style_append(result, unit[0]); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } } if (value[1] == BACKGROUND_POSITION_VERT_SET) { - css__stylesheet_style_append(result, length[1]); - css__stylesheet_style_append(result, unit[1]); + error = css__stylesheet_style_append(result, length[1]); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } + + error = css__stylesheet_style_append(result, unit[1]); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } } } |