From ba41f7d53c2898b45442506549685adcd5066403 Mon Sep 17 00:00:00 2001 From: Kit Chan Date: Wed, 19 Jul 2023 13:41:57 -0700 Subject: [PATCH 1/2] initialize variables reported by oss-fuzz --- src/tscore/Regex.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc index e8195f0de28..0002c292d41 100644 --- a/src/tscore/Regex.cc +++ b/src/tscore/Regex.cc @@ -55,10 +55,10 @@ Regex::Regex(Regex &&that) noexcept : regex(that.regex), regex_extra(that.regex_ bool Regex::compile(const char *pattern, const unsigned flags) { - const char *error; - int erroffset; - int options = 0; - int study_opts = 0; + const char *error = NULL; + int erroffset = 0; + int options = 0; + int study_opts = 0; if (regex) { return false; From 650a20256b717cc2ccd2cf736b371b580edbf7ee Mon Sep 17 00:00:00 2001 From: Kit Chan Date: Thu, 20 Jul 2023 15:57:43 -0700 Subject: [PATCH 2/2] fix according to comments --- src/tscore/Regex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc index 0002c292d41..22bb2e1c9ec 100644 --- a/src/tscore/Regex.cc +++ b/src/tscore/Regex.cc @@ -55,7 +55,7 @@ Regex::Regex(Regex &&that) noexcept : regex(that.regex), regex_extra(that.regex_ bool Regex::compile(const char *pattern, const unsigned flags) { - const char *error = NULL; + const char *error = nullptr; int erroffset = 0; int options = 0; int study_opts = 0;