Fix otp write length check.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-10-27 01:41:12 +02:00
parent 9de1b4ca5d
commit ccec83dfb1
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -270,7 +270,7 @@ int cmd_extras() {
else {
apdu.nc -= 2;
apdu.data += 2;
if (!(apdu.nc % 2)) {
if (apdu.nc % 2) {
return SW_WRONG_DATA();
}
int ret = otp_write_data(row, apdu.data, apdu.nc);