Fix native crash in nfc_ncif_proc_activate

The destination of memcpy is allocated with a predetermined maximum
length, but in some cases the length of information being copied is
greater than the maximum length of the destination.
This is the root cause of crash.

Add length check before memcpy to avoid memory overflow

Test: Repeat reading and writing tag
Bug: 33434992
Bug: 32688507
Change-Id: I09ee3c734e9be38a35b1d48679d74e42e0432d78
(cherry picked from commit 09cb3b3dc46c8bab51346a4163b130857d806418)
(cherry picked from commit 08ecbb211cdbd37bc9c3293dae74fbd569eb0bc4)
1 file changed
tree: 85979f031b678bd82f50847b178afd7b8a40846f
  1. halimpl/
  2. p61-jcop-kit/
  3. src/
  4. Android.mk
  5. CleanSpec.mk
  6. MODULE_LICENSE_APACHE2
  7. NOTICE
  8. README.md
  9. README.md~
README.md

#NFC_NCIHAL_libnfc-nci

####Git Repository

DESCRIPTIONCHECKOUT COMMAND
NFC_NCIHAL_libnfc-ncigit clone https://github.com/NXPNFCProject/NFC_NCIHAL_libnfc-nci.git

####Supported Versions on "master" Branch

Android VersionNXP ReleaseNXP Tag
android-5.0.0_r1/android5.1.0_r13.5.0_L (PN547C2/PN548C2)NFC_NCIHALx_AR0F.3.5.0_L_OpnSrc

####Supported Versions on "br_android_ncihalx_m" Branch

Android VersionNXP ReleaseNXP Tag
android-6.0.0_r14.2.0_M (PN547C2/PN548C2)NFC_NCIHALx_AR0F.4.2.0_M_OpnSrc
android-6.0.0_r14.3.0_M (PN547C2/PN548C2)NFC_NCIHALx_AR0F.4.3.0_M_OpnSrc
android-6.0.1_r174.5.0_M (PN551/PN548C2)NFC_NCIHALx_AR3C.4.5.0_M_OpnSrc
android-6.0.1_r174.7.0_M (PN553)NFC_NCIHALx_ARC0.4.7.0_M_OpnSrc
android-6.0.1_r174.8.0_M (PN551/PN548C2)NFC_NCIHALx_AR3C.4.8.0_M_OpnSrc

####Supported Versions on "br_android_ncihalx_n" Branch

Android VersionNXP ReleaseNXP Tag
android-7.0.0_r17.0.3_N (PN548C2/PN551)NFC_NCIHALx_AR3C.7.0.3_N_OpnSrc
android-7.0.0_r47.0.4_N (PN553)NFC_NCIHALx_ARC0.7.0.4_N_OpnSrc
android-7.0.0_r127.1.0_N (PN548C2/PN551/PN553)NFC_NCIHALx_ARFC.7.1.0_N_OpnSrc
android-7.0.0_r127.2.0_N (PN553)NFC_NCIHALx_ARC0.7.2.0_N_OpnSrc
android-7.0.0_r127.3.0_N (PN553)NFC_NCIHALx_ARC0.7.3.0_N_OpnSrc