programs: cert_write: fixed bug in parsing dec serial

Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
Valerio Setti
2023-01-12 17:01:45 +01:00
parent 856cec45eb
commit 48fdbb3940
+1 -1
View File
@@ -277,7 +277,7 @@ int parse_serial_decimal_format(unsigned char *obuf, size_t obufmax,
val = (dec >> ((remaining_bytes - 1) * 8)) & 0xFF;
/* Skip leading zeros */
if ((val) != 0) {
if ((val != 0) || (*len != 0)) {
*p = val;
(*len)++;
p++;