diff --git a/src/pkcs1_decode.c b/src/pkcs1_decode.c index 5bf3a5ed..dd246d39 100644 --- a/src/pkcs1_decode.c +++ b/src/pkcs1_decode.c @@ -252,11 +252,12 @@ EXPORT_SYM int pkcs1_decode(const uint8_t *em, size_t len_em_output, * It can be len_em_output when the 0 is not present. * It can SIZE_T_MAX in case of other errors. */ - pos = safe_search(em + 10, 0, len_em_output - 10) + 10; + pos = safe_search(em + 10, 0, len_em_output - 10); if (pos == SIZE_T_MAX) { result = -1; goto end; } + pos += 10; /* * selector is 0 if: