Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Sat Apr 11 19:34:25 2026
(Merged from https://github.com/openssl/openssl/pull/30647)
if (sc == NULL)
return;
- if (sc->statem.state == MSG_FLOW_ERROR) {
+ if (sc->statem.state == MSG_FLOW_ERROR
+ && sc->statem.error_state == ERROR_STATE_NOERROR) {
l = ERR_peek_error();
- if (l != 0) {
- if (ERR_GET_LIB(l) == ERR_LIB_SYS)
- sc->statem.error_state = ERROR_STATE_SYSCALL;
- else
- sc->statem.error_state = ERROR_STATE_SSL;
- }
+ if (l == 0 || ERR_GET_LIB(l) == ERR_LIB_SYS)
+ sc->statem.error_state = ERROR_STATE_SYSCALL;
+ else
+ sc->statem.error_state = ERROR_STATE_SSL;
}
}