]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/RegularExpressionDxe: Add null pointer check
authorDongao Guo <dongao.guo@intel.com>
Thu, 11 Oct 2018 06:57:03 +0000 (14:57 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 16 Oct 2018 07:24:23 +0000 (15:24 +0800)
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>
MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c

index c71ae5fa700c55fbe6c60fac0e145c6549ecd329..0a2d6f89e5fce8885e382abb93377959ad157424 100644 (file)
@@ -1572,6 +1572,7 @@ onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType callout_type,
     fe->arg_types[i] = arg_types[i];\r
   }\r
   for (i = arg_num - opt_arg_num, j = 0; i < arg_num; i++, j++) {\r
+    if(IS_NULL(opt_defaults))return ONIGERR_INVALID_ARGUMENT;\r
     if (fe->arg_types[i] == ONIG_TYPE_STRING) {\r
       OnigValue* val = opt_defaults + j;\r
       UChar* ds = onigenc_strdup(enc, val->s.start, val->s.end);\r