NTAG424DNA - ChangeFileSettingsSDM NULL consistency / Don't append non-flagged bytes

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

NTAG424DNA - ChangeFileSettingsSDM NULL consistency / Don't append non-flagged bytes

1,023 次查看
eljeffo
Contributor III

In NxpNfcRdLib/comps/phalMfNtag42XDna/src/Sw/phalMfNtag42XDna_Sw.c

There is a line for phalMfNtag42XDna_Sw_ChangeFileSettingsSDM that reads:

    if(pSDMENCLen > 0)

For consistency it should be 

    if(pSDMENCLen != NULL)

 

Also would suggest that != NULL is insufficient as a check.  Bytes should only be appended if both A) SdmOptions has the proper bit flag set and B) the pointer to the matching data array is not NULL. 

This leads to malformed messages when data is provided and the flag is not set.

This also means that users of the SDK require more logic in the application side than necessary, forcing users to NULL out pointers when a simple bit-clear would be sufficient as an indicator of non-use.

标签 (1)
0 项奖励
回复
1 回复

1,001 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello,

When this API is called for somewhere, this variable has been asserted it is a NULL or not , so it is reasonable to judge the input paramerters like this inside function.

Best Regards,

Thanks!

kelly

0 项奖励
回复