diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index c298e1616..1e46f93ec 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -79,7 +79,8 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), ERR_error_string_n(l, buf, sizeof buf); BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf, file, line, (flags & ERR_TXT_STRING) ? data : ""); - cb(buf2, strlen(buf2), u); + if (cb(buf2, strlen(buf2), u) <= 0) + break; /* abort outputting the error report */ } }