MdeModulePkg: Add NULL pointer check for RegularExpressionDxe.
Refine code by adding NULL pointer check to avoid potential NULL pointer dereferenced. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19271 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -308,6 +308,10 @@ onig_error_code_to_str(s, code, va_alist)
|
||||
|
||||
default:
|
||||
q = onig_error_code_to_format(code);
|
||||
if (q == NULL) {
|
||||
len = 0;
|
||||
break;
|
||||
}
|
||||
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);
|
||||
xmemcpy(s, q, len);
|
||||
s[len] = '\0';
|
||||
|
Reference in New Issue
Block a user