From abdab90859a7299b2cf7eb6c3f6e68df9d17d1d7 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 6 Apr 2017 17:14:58 +0100 Subject: Presentational hints: Ensure length is initialised for auto margins. Although the length is unused when margin is auto, having uninitialised values present in a computed style means that the style hashing may give the same style different hashes depending on the unintitialised info. The effect of this would have been be to reduce the chance of computed style sharing. It would have had no effect on page rendering. --- content/handlers/css/hints.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/handlers/css/hints.c b/content/handlers/css/hints.c index a96212386..9fe9ffb12 100644 --- a/content/handlers/css/hints.c +++ b/content/handlers/css/hints.c @@ -882,6 +882,7 @@ static void css_hint_margin_left_right_align_center( corestring_dom_align, &attr); if (exc == DOM_NO_ERR && attr != NULL) { + memset(hint, 0, sizeof(*hint) * 2); if (dom_string_caseless_lwc_isequal(attr, corestring_lwc_center) || dom_string_caseless_lwc_isequal(attr, @@ -1022,6 +1023,7 @@ static void css_hint_margin_left_right_hr( corestring_dom_align, &attr); if (exc == DOM_NO_ERR && attr != NULL) { + memset(hint, 0, sizeof(*hint) * 2); if (dom_string_caseless_lwc_isequal(attr, corestring_lwc_left)) { hint->prop = CSS_PROP_MARGIN_LEFT; -- cgit v1.2.3