mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-26 12:35:20 +00:00
programs: cert_write: fixed bug in parsing dec serial
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
parent
856cec45eb
commit
48fdbb3940
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user