Within function GetAllocationDescriptorLsn():
The call to GetPdFromLongAd() may return NULL and it will be later
dereferenced in GetShortAdLsn().
This commit adds ASSERT to resolve the potential NULL pointer
dereference.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <pcacjr@zytor.com>
IN VOID *Ad\r
)\r
{\r
+ UDF_PARTITION_DESCRIPTOR *PartitionDesc;\r
+\r
if (RecordingFlags == LongAdsSequence) {\r
return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad);\r
} else if (RecordingFlags == ShortAdsSequence) {\r
+ PartitionDesc = GetPdFromLongAd (Volume, ParentIcb);\r
+ ASSERT (PartitionDesc != NULL);\r
+\r
return GetShortAdLsn (\r
Volume,\r
- GetPdFromLongAd (Volume, ParentIcb),\r
+ PartitionDesc,\r
(UDF_SHORT_ALLOCATION_DESCRIPTOR *)Ad\r
);\r
}\r