d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.09k stars 190 forks source link

Fix buffer overflow when encrypting/decrypting CIA files non-inplace #803

Closed ZeroSkill1 closed 1 year ago

ZeroSkill1 commented 1 year ago

The issue would occur when encrypting or decrypting CIA files (that have a meta region) to 0:/gm9/out. It is caused by passing a pointer to a buffer that is not large enough to hold the CIA meta section. The solution is to allocate a separate buffer, as has been done in other places where the meta section is copied.

d0k3 commented 1 year ago

Approved and taken over. Thank you!