summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/RegularExpressionDxe
AgeCommit message (Collapse)AuthorFilesLines
2023-11-13MdeModulePkg/RegularExpressinoDxe: Fix clang errorJake Garver via groups.io1-0/+1
Ignore old style declaration warnings in oniguruma/src/st.c. This was already ignored for MSFT, but newer versions of clang complain as well. Signed-off-by: Jake Garver <jake@nvidia.com> Reviewed-by: Nhi Pham <nhi@os.amperecomputing.com> Tested-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-04-28MdeModulePkg/RegularExpressionDxe: Fix Arm build errorNickle Wang2-4/+11
Arm CI build error: - ArmPkg/Library/CompilerIntrinsicsLib/memset.c:39:1: warning: type of ‘memset’ does not match original declaration [-Wlto-type-mismatch] MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c:123:1: note: type ‘char’ should match type ‘int’ - multiple definition of `memcpy'; OnigurumaUefiPort.obj (symbol from plugin):(.text+0x0): first defined here Fix: - Update memset() implementation to match memset() definition in ArmPkg/Library/CompilerIntrinsicsLib. - memcpy() is supported by ArmPkg/Library/CompilerIntrinsicsLib. Exclude it in OnigurumaUefiPort.c. Signed-off-by: Nickle Wang <nicklew@nvidia.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Nick Ramirez <nramirez@nvidia.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-04-13MdeModulePkg/RegularExpressionDxe: Fix GCC build errordevel@edk2.groups.io1-4/+3
Fix GCC build error on AARCH64 system. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Nick Ramirez <nramirez@nvidia.com> Signed-off-by: Nickle Wang <nicklew@nvidia.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2021-12-07MdeModulePkg: Apply uncrustify changesMichael Kubacki4-126/+201
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-12-07MdeModulePkg: Change OPTIONAL keyword usage styleMichael D Kinney2-5/+5
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-07-07MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()Nickle Wang2-13/+20
Memory buffer that is allocated by malloc() and realloc() will be shifted by 8 bytes because Oniguruma keeps its memory signature. This 8 bytes shift is not handled while calling free() to release memory. Add free() function to check Oniguruma signature before release memory because memory buffer is not touched when using calloc(). Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2020-12-14MdeModulePkg: Fix SetMem parameter in OnigurumaUefiPortBaraneedharan Anbazhagan1-1/+1
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3085 Coding error in converting memset call to SetMem - Length and Value is not swapped on calling SetMem Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2020-05-14MdeModulePkg/RegularExpressionDxe: Optimize the code infrastructureShenglei Zhang4-49/+12
OnigurumaIntrinsics.c is now not used. So the implement of function 'memcpy' is now not., which causes build failure with CLANG9 and XCODE. I remove OnigurumaIntrinsics.c and move the necessary function implement to OnigurumaUefiPort.c/h. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2020-04-13MdeModulePkg/RegularExpressionDxe: Make oniguruma a submodule in edk2.Shenglei Zhang48-75747/+232
Use submodule way to access oniguruma. And upgrade oniguruma version from v6.9.3 to v6.9.4_mark1. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2073 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-11-15MdeModulePkg RegularExpressionDxe: Update tool chain name to CLANGPDBLiming Gao1-1/+1
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2341 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2019-11-04MdeModulePkg/Oniguruma: Remove redundant IF statementShenglei Zhang4-44/+26
The if statement is not necessary, so keep it to edk2 style. And this change has been merged to onigruma. REF:https://github.com/kkos/oniguruma/pull/158 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-10-24MdeModulePkg RegularExpressionDxe: Disable warning for CLANG9 tool chainLiming Gao1-0/+3
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-10-04MdeModulePkg: strip trailing whitespaceLeif Lindholm3-3/+3
Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-08-13MdeModulePkg/RegularExpressionDxe: Add two missing null pointer checksLiming Gao1-0/+2
After update Oniguruma from v6.9.0 to v6.9.3, two null pointer check should be added. This change bases on the patch https://edk2.groups.io/g/devel/message/45183. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-08-13MdeModulePkg RegularExpressionDxe: Update Oniguruma from v6.9.0 to v6.9.3Liming Gao25-11282/+14041
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2066 Update Oniguruma to the latest version v6.9.3. Oniguruma https://github.com/kkos/oniguruma This release is the security fix release. It includes the changes: Fixed CVE-2019-13224 Fixed CVE-2019-13225 Fixed many problems (found by libfuzzer programs) Verify VS2015, GCC5 build. Verify RegularExpressionProtocol GetInfo() and Match() function. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-04-09MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney6-42/+6
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2018-11-02MdeModulePkg: Remove the trailing space in three source files.Liming Gao1-1/+1
The recent changes in these three source files introduce the trailing space. This patch removes them to follow edk2 coding style. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-10-26MdeModulePkg RegularExpressionDxe: Remove unknown build option for XCODELiming Gao1-0/+4
This patch makes RegularExpressionDxe pass XCODE5 build. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-10-16MdeModulePkg/RegularExpressionDxe: Add null pointer checkDongao Guo1-0/+1
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>
2018-10-15MdeModulePkg RegularExpressionDxe: Enable STDARG for variable argumentsLiming Gao2-1/+3
Set macro for variable arguments, and remove the hard code definition to avoid the potential duplicated definition. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Dongao Guo <dongao.guo@intel.com>
2018-10-15MdeModulePkg/RegularExpressionDxe: Add null pointer checkDongao Guo2-5/+34
There are five check not necessary in logic ,just for pass static analysis. More detail please refer to comment in code. And the rest changes are all accepted by owner, they are reasonable. 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>
2018-10-15MdeModulePkg/RegularExpressionDxe: Miss null pointer checkDongao Guo1-0/+5
Oniguruma https://github.com/kkos/oniguruma this change is merged from oniguruma develop branch. from commit 1db8a2726dfad0401f928cb8474bd770f07040a7. 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>
2018-10-15MdeModulePkg/RegularExpressionDxe: Miss null pointer checkDongao Guo3-1/+39
Oniguruma https://github.com/kkos/oniguruma this change is merged from oniguruma develop branch. from commit ea36d810f1d9b28f3ef20bd8d453bea2f7fb598b 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>
2018-10-15MdeModulePkg/RegularExpressionDxe: Miss null pointer checkDongao Guo1-3/+6
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>
2018-10-11MdeModulePkg/RegularExpressionDxe:omit unused variableGuo, Dongao2-17/+14
comment unused variable to avoid warning,and modify inf build option. 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>
2018-10-11MdeModulePkg/RegularExpressionDxe:disable wraning to pass gcc4.8 buildGuo, Dongao1-0/+3
There are three warnings reported by GCC 4.8 and the later GCC release are workaround with them. And all the three warnings are invalid,so I just disable warnings rather than fix them at now. Following is the analysis from Laszlo Ersek. (1) > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c: In > function 'compile_length_tree': > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regcomp.c:1516:7: > warning: 'len' may be used uninitialized in this function > [-Wmaybe-uninitialized] > int len; > ^ I think this is an invalid warning; the type of the controlling expression (node->type) is enum GimmickType, and the case labels cover all values of the enum. An assert(0) could be added, I guess, but again, upstream Oniguruma would be justified to reject the idea. (2) > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In > function 'parse_callout_args.isra.10.constprop.30': > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6753:25: > warning: 'rl' may be used uninitialized in this function > [-Wmaybe-uninitialized] > vals[n].l = rl; > ^ This warning is invalid, given: 6749 if (cn > 0) { 6750 long rl; 6751 r = parse_long(enc, buf, bufend, 1, LONG_MAX, &rl); 6752 if (r == ONIG_NORMAL) { 6753 vals[n].l = rl; Because parse_long() only returns ONIG_NORMAL after it sets (*rl). (3) > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c: In > function 'parse_callout_of_name.constprop.29': > MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regparse.c:6861:38: > warning: 'tag_end' may be used uninitialized in this function > [-Wmaybe-uninitialized] > if (! is_allowed_callout_tag_name(enc, tag_start, tag_end)) This warning is also invalid, given: 6852 if (c == '[') { 6853 if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; 6854 tag_start = p; 6855 while (! PEND) { 6856 if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; 6857 tag_end = p; 6858 PFETCH_S(c); 6859 if (c == ']') break; 6860 } 6861 if (! is_allowed_callout_tag_name(enc, tag_start, tag_end)) 6862 return ONIGERR_INVALID_CALLOUT_TAG_NAME; 6863 To see that, first we should note: #define PEND (p < end ? 0 : 1) therefore PEND doesn't change if neither "p" nor "end" change. Second, when we reach line 6855 (the "while") for the very first time, (!PEND) is certainly true (i.e., PEND is false), because otherwise we would have bailed at line 6853. Therefore we reach line 6857, and assign "tag_end". Regardless of whether we iterate zero or more *additional* times around the loop, "tag_end" will have been set, whenever we reach line 6861. 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: Laszlo Ersek <lersek@redhat.com>
2018-09-28MdeModulePkg/RegularExpressionDxe: modify inf to pass vs 2012 buildGuo, Dongao1-1/+1
Add /wd4703 for passing VS 2012 build.This equals /wd4701 in VS2015. 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>
2018-09-25MdeModulePkg RegularExpressionDxe: Update Oniguruma to 6.9.0Dongao Guo35-19090/+58992
https://bugzilla.tianocore.org/show_bug.cgi?id=1200 Update Oniguruma to the latest version v6.9.0. Oniguruma https://github.com/kkos/oniguruma Verify VS2017, GCC5 build. Verify RegularExpressionProtocol GetInfo() and Match() function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dongao Guo <dongao.guo@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com>
2018-09-06MdeModulePkg: Removing ipf which is no longer supported from edk2.Chen A Chen1-2/+1
Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-28MdeModulePkg: Clean up source filesLiming Gao2-9/+9
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-08-16MdeModulePkg: Delete useless case codeSong, BinX2-21/+0
- Delete useless case code to fix /WHOLEARCHIVE build error with VS2015 tool chain Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-08-16MdeModulePkg: Delete never touched codeSong, BinX2-4/+2
- Delete never touched code Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-05-24MdeModulePkg/RegularExpressionDxe: Fix XCODE5 build failureMichael Kinney1-1/+1
https://bugzilla.tianocore.org/show_bug.cgi?id=572 The ErrorMessage local variable in OnigurumaMatch() should be type OnigUChar instead of type CHAR8. This resolves a build failure with the XCODE5 tool chain. Cc: Andrew Fish <afish@apple.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-04-07MdeModulePkg RegularExpressionDxe: Remove GCC -fno-builtin optionLiming Gao1-1/+0
GCC -fno-builtin option is added into tools_def.template at 90defe7198a42b3157ae5d9b93714f891cf06e57. So, there is no need to set it in module INF file. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-10-27MdeModulePkg/RegularExpressionDxe: remove module-local ARRAY_SIZE macroLaszlo Ersek1-4/+0
Rely on the central macro definition from "MdePkg/Include/Base.h" instead. Cc: Cecil Sheng <cecil.sheng@hpe.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@Intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-10-27MdeModulePkg/RegularExpressionDxe: guard the definition of ARRAY_SIZELaszlo Ersek1-0/+2
In one of the next patches, we'll introduce ARRAY_SIZE in "MdePkg/Include/Base.h". In order to proceed in small steps, make the module-local definition of ARRAY_SIZE conditional. This way the introduction of the macro under MdePkg will silently switch this module over (after which we can remove the module-local definition completely). Cc: Cecil Sheng <cecil.sheng@hpe.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@Intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-10-12MdeModulePkg RegularExpressionDxe: Add the missing EFIAPI for the functionLiming Gao5-4/+6
The function with the variable parameters should have EFIAPI. Cc: Feng Tian <feng.tian@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Cc: Cecil Sheng <cecil.sheng@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-17MdeModulePkg: Fixed incorrect return value of MatchStringCecil Sheng1-5/+29
In UEFI2.6, CapturePtr's in the Captures array returned by MatchString are to be separatedly allocated so that they can be freed by the caller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-02-26MdeModulePkg: RegularExpressionDxe: support free(NULL)Laszlo Ersek1-1/+11
The ISO C standard says about free(), If ptr is a null pointer, no action occurs. This is not true of the FreePool() interface of the MemoryAllocationLib class: Buffer must have been allocated on a previous call to the pool allocation services of the Memory Allocation Library. [...] If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, then ASSERT(). Therefore we must not forward the argument of free() to FreePool() without checking. Cc: Cecil Sheng <cecil.sheng@hpe.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Qiu Shumin <shumin.qiu@intel.com> Cc: Samer El-Haj-Mahmoud <elhaj@hpe.com> Cc: Yao Jiewen <Jiewen.Yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-By: Cinnamon Shia <cinnamon.shia@hpe.com>
2016-01-04MdeModulePkg: For RegularExpressionDxe use 'sprintf_s' to replace 'sprintf'.Qiu Shumin5-8/+12
Function 'sprintf' has potential buffer overflow risk. This patch use 'sprintf_s' to improve the code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19582 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-18MdeModulePkg: Fix VS2012 build failure.Qiu Shumin1-1/+4
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19365 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16MdeModulePkg: Fix RegularExpressionDxe memcpy intrinsic.Samer El-Haj-Mahmoud2-7/+9
Use explicit CopyMem to resolve intrinsic memcpy errors on some compilers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19292 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15MdeModulePkg: Add NULL pointer check for RegularExpressionDxe.Qiu Shumin7-4/+50
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
2015-12-04MdeModulePkg: Fix VS2015 warning C4311 & C4312 in RegularExpressionDxeLiming Gao4-39/+39
warning C4311: pointer truncation from 'void *' to 'unsigned long' warning C4312: conversion from 'unsigned long' to 'void *' of greater size Update code to convert type to UINTN first, then convert it to other type. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com> Acked-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19114 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-04MdeModulePkg: Fix VS2015 warning C4456 in RegularExpressionDxeLiming Gao2-10/+10
warning C4456: declaration of 'q' hides previous local declaration. Update code to use the different local variable name. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com> Acked-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19113 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-03MdeModulePkg/RegularExpressionDxe: Add missing PrintLibCinnamon Shia1-0/+1
AsciiVSPrint is used in RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c. But PrintLib is missing in RegularExpressionDxe.inf. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18721 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-03MdeModulePkg/RegularExpressionDxe: Correct copyrightCinnamon Shia15-15/+15
Correct copyrights in RegularExpressionDxe Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18720 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-11MdeModulePkg:Refine the code comments in RegularExpressionDxe.Dandan Bi3-112/+150
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18444 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-09Fixed GCC tool chain build fail.Cecil Sheng1-128/+128
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18419 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-08MdeModulePkg: Regular expression protocolCecil Sheng31-0/+33646
Add driver to produce EFI_REGULAR_EXPRESSION_PROTOCOL. Based on Oniguruma v5.9.6 (BSD 2-clause license), which provides full Unicode support, and POSIX ERE and Perl regex syntaxes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18413 6f19259b-4bc3-4df7-8a09-765794883524