On 8 November 2018 at 02:09, Zeng, Star <star.z...@intel.com> wrote:
> Reviewed-by: Star Zeng <star.z...@intel.com>
>
> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, November 7, 2018 10:53 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming....@intel.com>; Dong, Eric <eric.d...@intel.com>; 
> Zeng, Star <star.z...@intel.com>; Wu, Hao A <hao.a...@intel.com>
> Subject: [patch] MdeModulePkg/DisplayEngine: Remove useless NULL ptr check 
> for NewPos
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1306
>
> In function UiDisplayMenu, the NewPos ptr which used to point to the 
> highlight menu entry. It will always point to the menu entry which need to be 
> highlighted or the gMenuOption menu if the highlight menu is not found.
> So we can remove the NULL ptr check for NewPos in this function.
> And add the ASSERT code to avoid if any false positive reports of NULL 
> pointer dereference issue raised from static analysis.
>
> Cc: Liming Gao <liming....@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Star Zeng <star.z...@intel.com>
> Cc: Hao Wu <hao.a...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan...@intel.com>

Why was this patch merged today? Surely, this doesn't meet the hard
freeze requirements ?

> ---
>  MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c 
> b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> index 7390f954b6..44f087fe01 100644
> --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> @@ -2880,10 +2880,11 @@ UiDisplayMenu (
>        //             MenuOption is set to NULL in Repaint
>        // NewPos:     Current menu option that need to hilight
>        //
>        ControlFlag = CfUpdateHelpString;
>
> +      ASSERT (NewPos != NULL);
>        UpdateHighlightMenuInfo(NewPos, TopOfScreen, SkipValue);
>
>        if (SkipHighLight) {
>          SkipHighLight = FALSE;
>          MenuOption    = SavedMenuOption;
> @@ -2908,11 +2909,11 @@ UiDisplayMenu (
>          Temp2 = SkipValue;
>        } else {
>          Temp2 = 0;
>        }
>
> -      if (NewPos != NULL && (MenuOption == NULL || NewPos != 
> &MenuOption->Link)) {
> +      if (MenuOption == NULL || NewPos != &MenuOption->Link) {
>          if (MenuOption != NULL) {
>            //
>            // Remove the old highlight menu.
>            //
>            Status = DisplayOneMenu (MenuOption,
> --
> 2.18.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to