summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/RegularExpressionDxe
diff options
context:
space:
mode:
authorDongao Guo <dongao.guo@intel.com>2018-10-11 14:57:03 +0800
committerLiming Gao <liming.gao@intel.com>2018-10-16 15:24:23 +0800
commit6d665168b0b630924a8d535316d053723998d658 (patch)
treec6f77562c698c76a781b621d2b86117667b34008 /MdeModulePkg/Universal/RegularExpressionDxe
parent47f15da16053f031bcf7c50f6960bd0f6c83d2db (diff)
downloadedk2-6d665168b0b630924a8d535316d053723998d658.tar.gz
edk2-6d665168b0b630924a8d535316d053723998d658.tar.bz2
edk2-6d665168b0b630924a8d535316d053723998d658.zip
MdeModulePkg/RegularExpressionDxe: Add null pointer check
This is the part of commit 3948c510edad901bb9f8d23f7bf0f4ae91b5fcde. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dongao Guo <dongao.guo@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/RegularExpressionDxe')
-rw-r--r--MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
index c71ae5fa70..0a2d6f89e5 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c
@@ -1572,6 +1572,7 @@ onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType callout_type,
fe->arg_types[i] = arg_types[i];
}
for (i = arg_num - opt_arg_num, j = 0; i < arg_num; i++, j++) {
+ if(IS_NULL(opt_defaults))return ONIGERR_INVALID_ARGUMENT;
if (fe->arg_types[i] == ONIG_TYPE_STRING) {
OnigValue* val = opt_defaults + j;
UChar* ds = onigenc_strdup(enc, val->s.start, val->s.end);