Hi Sergey,

The first issue is a true issue, I will follow up to fix it.

The second issue is not an issue, because the type of VolumeLabel is UINT16 * 
not array, it just use the same name as the member in 
EFI_FILE_SYSTEM_VOLUME_LABEL structure.
[cid:[email protected]]

BTW, which tool do you use to detect this issue?

Thanks,
Eric
From: Sergey Isakov [mailto:[email protected]]
Sent: Thursday, September 11, 2014 3:47 PM
To: [email protected]
Subject: [edk2] VolumeLabel is never NULL

Hi,

In the module 
edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c:373 I got 
a warning said that the comparison is always FALSE
---------
        if (FileContext->Info->VolumeLabel == NULL) {
          VolumeLabel = L"NULL VOLUME LABEL";
        } else {
---------
because the field VolumeLabel is declared as array (in the structure 
EFI_FILE_SYSTEM_VOLUME_LABEL *Info)
-----
typedef struct {
  ///
  /// The Null-terminated string that is the volume's label.
  ///
  CHAR16  VolumeLabel[1];
} EFI_FILE_SYSTEM_VOLUME_LABEL;

-------
and the array is never equal to pointer NULL.
Moreover such assignments are not possible
-------
VolumeLabel = L"NULL VOLUME LABEL";
--------
because of the array size.
It must be reallocation of Info structure with new size.

Regards,
Sergey
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to