//\r
while (AnswerSectionNum < DnsHeader->AnswersNum) {\r
//\r
- // Answer name should be PTR.\r
+ // Answer name should be PTR, else EFI_UNSUPPORTED returned.\r
//\r
- ASSERT ((*(UINT8 *) AnswerName & 0xC0) == 0xC0);\r
+ if ((*(UINT8 *) AnswerName & 0xC0) != 0xC0) {\r
+ Status = EFI_UNSUPPORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
//\r
// Get Answer section.\r
//\r
// This is address entry, get Data.\r
//\r
- ASSERT (Dns4TokenEntry != NULL && AnswerSection->DataLength == 4);\r
+ ASSERT (Dns4TokenEntry != NULL);\r
+\r
+ if (AnswerSection->DataLength != 4) {\r
+ Status = EFI_ABORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
HostAddr4 = Dns4TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
//\r
// This is address entry, get Data.\r
//\r
- ASSERT (Dns6TokenEntry != NULL && AnswerSection->DataLength == 16);\r
+ ASSERT (Dns6TokenEntry != NULL);\r
+\r
+ if (AnswerSection->DataLength != 16) {\r
+ Status = EFI_ABORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
HostAddr6 = Dns6TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r