<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic NTAG424DNA - ChangeFileSettingsSDM NULL consistency / Don't append non-flagged bytes in NFC</title>
    <link>https://community.nxp.com/t5/NFC/NTAG424DNA-ChangeFileSettingsSDM-NULL-consistency-Don-t-append/m-p/1512502#M9609</link>
    <description>&lt;P&gt;In&amp;nbsp;&lt;SPAN class=""&gt;NxpNfcRdLib/comps/phalMfNtag42XDna/src/Sw/phalMfNtag42XDna_Sw.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There is a line for&amp;nbsp;&lt;SPAN class=""&gt;phalMfNtag42XDna_Sw_ChangeFileSettingsSDM&amp;nbsp;&lt;/SPAN&gt;that reads:&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&lt;SPAN class=""&gt;(pSDMENCLen &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;For consistency it should be&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&lt;SPAN class=""&gt;(pSDMENCLen != NULL&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Also would suggest that != NULL is insufficient as a check.&amp;nbsp; 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.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;This leads to malformed messages when data is provided and the flag is not set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;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.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 16:45:51 GMT</pubDate>
    <dc:creator>eljeffo</dc:creator>
    <dc:date>2022-08-26T16:45:51Z</dc:date>
    <item>
      <title>NTAG424DNA - ChangeFileSettingsSDM NULL consistency / Don't append non-flagged bytes</title>
      <link>https://community.nxp.com/t5/NFC/NTAG424DNA-ChangeFileSettingsSDM-NULL-consistency-Don-t-append/m-p/1512502#M9609</link>
      <description>&lt;P&gt;In&amp;nbsp;&lt;SPAN class=""&gt;NxpNfcRdLib/comps/phalMfNtag42XDna/src/Sw/phalMfNtag42XDna_Sw.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There is a line for&amp;nbsp;&lt;SPAN class=""&gt;phalMfNtag42XDna_Sw_ChangeFileSettingsSDM&amp;nbsp;&lt;/SPAN&gt;that reads:&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&lt;SPAN class=""&gt;(pSDMENCLen &amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;For consistency it should be&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&lt;SPAN class=""&gt;(pSDMENCLen != NULL&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Also would suggest that != NULL is insufficient as a check.&amp;nbsp; 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.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;This leads to malformed messages when data is provided and the flag is not set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 16:45:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NTAG424DNA-ChangeFileSettingsSDM-NULL-consistency-Don-t-append/m-p/1512502#M9609</guid>
      <dc:creator>eljeffo</dc:creator>
      <dc:date>2022-08-26T16:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: NTAG424DNA - ChangeFileSettingsSDM NULL consistency / Don't append non-flagged bytes</title>
      <link>https://community.nxp.com/t5/NFC/NTAG424DNA-ChangeFileSettingsSDM-NULL-consistency-Don-t-append/m-p/1514270#M9624</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;kelly&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 02:42:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NTAG424DNA-ChangeFileSettingsSDM-NULL-consistency-Don-t-append/m-p/1514270#M9624</guid>
      <dc:creator>KaiLi</dc:creator>
      <dc:date>2022-08-31T02:42:06Z</dc:date>
    </item>
  </channel>
</rss>

