FCI buffer size of when calling phalVca_IsoSelect()

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

FCI buffer size of when calling phalVca_IsoSelect()

2,220件の閲覧回数
timriddermann
Contributor II

Hello.

I wonder how big the buffer size of the FCI must be when I call the function phalVca_IsoSelect()?


In an example of the NXP Reader Library for DESFire EV2, the buffer "uint8_t FCI[40];" is created and passed to the function.However, I am afraid that a buffer overflow can occur if an FCI is received from the DESFire which is larger than 40 bytes. As far as I know this can happen if the file 31 of the DESFire is larger than 40 bytes.

Best regards,
Tim

ラベル(1)
2 返答(返信)

1,962件の閲覧回数
timriddermann
Contributor II

Hi,

sorry for the late repy. I was not notified of your reply and then I forgot about this thread a bit....

My question is not so much about the example but more about how the method 'phalVca_IsoSelect()' is to be used. I took a closer look at the code and think that a buffer overflow is possible in the method 'phalVca_Sw_IsoSelect()' (in file 'phalVca_Sw.c'), which is called from 'phalVca_IsoSelect()'.

My concerns is that 'pFCI' will overflow if the file 31 of a DESFire is larger than the buffer behind 'pFCI'. The memcpy is wrong in my opinion without a prior check of the buffer size.

 

 

"NFC Reader Library v06.11.00 for CLRC663 including all software examples"; File 'phalVca_Sw.c'; line 735-737

/* FCI contains contents of FileID 31 of the DF */
memcpy(pFCI, &pRecv[0], wRxlen-2);
*pwFCILen = wRxlen - 2;

0 件の賞賛
返信

2,178件の閲覧回数
Jonathan_Iglesias
NXP TechSupport
NXP TechSupport

Hi ,

I am not sure to which example for EV2 you are referring, the examples available are for EV1. 

 

BR

 

Jonathan

0 件の賞賛
返信