From d82c54bd3033cc3277ebeb4854739bebe4e20f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 31 Jan 2018 17:43:29 +0100 Subject: [PATCH] stylo: Fix missing null terminators in error reporting code. This was causing the patch in bug 1420026 to fail. --- components/style/error_reporting.rs | 1 + ports/geckolib/error_reporter.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/style/error_reporting.rs b/components/style/error_reporting.rs index b3661846ccf..c1446eaa0a0 100644 --- a/components/style/error_reporting.rs +++ b/components/style/error_reporting.rs @@ -13,6 +13,7 @@ use style_traits::ParseError; use stylesheets::UrlExtraData; /// Errors that can be encountered while parsing CSS. +#[derive(Debug)] pub enum ContextualParseError<'a> { /// A property declaration was not recognized. UnsupportedPropertyDeclaration(&'a str, ParseError<'a>), diff --git a/ports/geckolib/error_reporter.rs b/ports/geckolib/error_reporter.rs index 61479838eff..d6f98efddaf 100644 --- a/ports/geckolib/error_reporter.rs +++ b/ports/geckolib/error_reporter.rs @@ -66,6 +66,7 @@ impl<'a> ErrorString<'a> { } } +#[derive(Debug)] enum Action { Nothing, Skip, @@ -370,14 +371,14 @@ impl<'a> ErrorHelpers<'a> for ContextualParseError<'a> { StyleParseErrorKind::ValueError( ValueParseErrorKind::InvalidColor(..) ) - ) => (b"PEColorNotColor", Action::Nothing), + ) => (b"PEColorNotColor\0", Action::Nothing), _ => { // Not the best error message, since we weren't parsing // a declaration, just a value. But we don't produce // UnsupportedValue errors other than InvalidColors // currently. debug_assert!(false, "should use a more specific error message"); - (b"PEDeclDropped", Action::Nothing) + (b"PEDeclDropped\0", Action::Nothing) } } }