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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

1,127件の閲覧回数
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,105件の閲覧回数
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 件の賞賛
返信