From cbe4a938468b4a18f80c2dfd4384cddd5066a50d Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 14 Aug 2026 22:23:54 +0200 Subject: [PATCH] Report object deletion failures Signed-off-by: Pol Henarejos --- src/openpgp/piv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openpgp/piv.c b/src/openpgp/piv.c index fb57d7c..a0074f0 100644 --- a/src/openpgp/piv.c +++ b/src/openpgp/piv.c @@ -1097,7 +1097,9 @@ static int cmd_piv_put_data(void) { file_put_data(ef, CONST_BYTE_ARRAY(a53.data, a53.len)); } else { - flash_clear_file(ef); + if (flash_clear_file(ef) != PICOKEYS_OK) { + return SW_MEMORY_FAILURE(); + } } flash_commit(); }