summaryrefslogtreecommitdiff
path: root/hwpfilter/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-02 15:27:44 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-03 09:16:48 +0200
commit3cc6384e41819eb8a5182a9ab7fd8f74d3cea9e5 (patch)
treeed5f5c754d85b1bc52832e6a4d186a52bbc5bceb /hwpfilter/source
parent5edaca5c892dbe07c0edb1ea0de4a115300e8ef0 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: Ibca9433761e7a7f97383991429cf0d575b4ba3d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167018 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'hwpfilter/source')
-rw-r--r--hwpfilter/source/formula.cxx2
-rw-r--r--hwpfilter/source/lexer.cxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx
index e220afe9d881..84982dcd9aae 100644
--- a/hwpfilter/source/formula.cxx
+++ b/hwpfilter/source/formula.cxx
@@ -580,6 +580,7 @@ void Formula::parse()
}
char *buf = static_cast<char *>(malloc(a.getLength()+1));
+ assert(buf && "Don't handle OOM conditions");
bool bStart = false;
int i, j;
for( i = 0, j=0 ; i < a.getLength() ; i++){ // rtrim and ltrim 32 10 13
@@ -618,6 +619,7 @@ void Formula::trim()
{
int len = strlen(eq);
char *buf = static_cast<char *>(malloc(len+1));
+ assert(buf && "Don't handle OOM conditions");
bool bStart = false;
int i, j;
for( i = 0, j=0 ; i < len ; i++){ // rtrim and ltrim 32 10 13
diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx
index cb6ae3fc4b49..844432268d92 100644
--- a/hwpfilter/source/lexer.cxx
+++ b/hwpfilter/source/lexer.cxx
@@ -220,7 +220,7 @@ typedef int yy_state_type;
static yy_state_type yy_get_previous_state YY_PROTO(( ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+[[noreturn]] static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.