diff options
author | Dongao Guo <dongao.guo@intel.com> | 2018-10-11 14:57:00 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-10-15 15:55:51 +0800 |
commit | 16bd7c35dfac1b077a9af3bd784145e67116da13 (patch) | |
tree | aef889e5cd63eed60f4988235389ab46b710a48c /MdeModulePkg/Universal/RegularExpressionDxe | |
parent | f1400101a732ee2e7e0f6d53712caec77ff695f9 (diff) | |
download | edk2-16bd7c35dfac1b077a9af3bd784145e67116da13.tar.gz edk2-16bd7c35dfac1b077a9af3bd784145e67116da13.tar.bz2 edk2-16bd7c35dfac1b077a9af3bd784145e67116da13.zip |
MdeModulePkg/RegularExpressionDxe: Miss null pointer check
Oniguruma https://github.com/kkos/oniguruma
this change is merged from oniguruma develop branch.
from commit 396a757dffafc0c7eb269433c29a0ba961d73ad6.
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.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c index d274873aae..6033d2166b 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c @@ -7725,8 +7725,9 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end, case TK_ALT:
case TK_EOT:
end_of_token:
- *np = node_new_empty();
- return tok->type;
+ *np = node_new_empty();
+ CHECK_NULL_RETURN_MEMERR(*np);
+ return tok->type;
break;
case TK_SUBEXP_OPEN:
@@ -7977,8 +7978,10 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end, if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) {
if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS))
return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED;
- else
+ else {
*np = node_new_empty();
+ CHECK_NULL_RETURN_MEMERR(*np);
+ }
}
else {
goto tk_byte;
|