summaryrefslogtreecommitdiffstats
path: root/crypto/err
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-05-15 00:34:06 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-05-15 00:34:06 +0000
commit19674b5a1d10bbd4bf0537d891e8908c1d572832 (patch)
tree29c195cd8a62227ba63a4dc315e708ceeeba8cd8 /crypto/err
parente855d538de55e879019dfbf1467b578e50b75730 (diff)
PR: 2253
Submitted By: Ger Hobbelt <ger@hobbelt.com> Check callback return value when outputting errors.
Diffstat (limited to 'crypto/err')
-rw-r--r--crypto/err/err_prn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index de32f332c4..a0168ac8ed 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -81,7 +81,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 */
}
}