summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-03-06 17:36:44 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2017-03-07 02:48:53 +0000
commit39ec34b867ee60a5da68fd1e5e08b476f0b0c0ca (patch)
treecae3d7fc5cb9976cf6cd09bdd4d2f5de3836428e /starmath
parentoss-fuzz: Module_xmlsecurity has gpg inside ENABLE_NSS (diff)
downloadcore-39ec34b867ee60a5da68fd1e5e08b476f0b0c0ca.tar.gz
core-39ec34b867ee60a5da68fd1e5e08b476f0b0c0ca.zip
starmath: Avoid creating SmFontNode with a default token
when an unexpected token is found. Change-Id: I1a11c08ce54c55bb32289498fbb26af019396b83 Reviewed-on: https://gerrit.libreoffice.org/34918 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/parse.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index a2ba86971b11..76c4b243332a 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1802,7 +1802,10 @@ void SmParser::DoColor()
NextToken();
}
else
+ {
Error(SmParseError::ColorExpected);
+ return;
+ }
} while (m_aCurToken.eType == TCOLOR);
m_aNodeStack.push_front(o3tl::make_unique<SmFontNode>(aToken));
@@ -1822,7 +1825,10 @@ void SmParser::DoFont()
NextToken();
}
else
+ {
Error(SmParseError::FontExpected);
+ return;
+ }
} while (m_aCurToken.eType == TFONT);
m_aNodeStack.push_front(o3tl::make_unique<SmFontNode>(aToken));