Balance ERR_set_mark by calling ERR_clear_last_mark on the success path.
Prevents a stale mark from skewing later error handling.
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28882)
if (e != ASN1_R_TOO_LONG)
goto err;
ERR_pop_to_mark();
+ ERR_set_mark();
}
off += q - p; /* end of data */
}
*pb = b;
+ ERR_clear_last_mark();
return (int)off;
err:
ERR_clear_last_mark();