summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/err
diff options
context:
space:
mode:
authorguenther <>2014-04-19 11:46:39 +0000
committerguenther <>2014-04-19 11:46:39 +0000
commitf376030ff7fe24f4ad44a56c2d8ba8796c9ab3f0 (patch)
tree1c4f9b095801061d57e575e80f245cef8a59a27f /src/lib/libcrypto/err
parent597610ccf04bbca4e88fac7988877d0a06e02211 (diff)
downloadopenbsd-f376030ff7fe24f4ad44a56c2d8ba8796c9ab3f0.tar.gz
openbsd-f376030ff7fe24f4ad44a56c2d8ba8796c9ab3f0.tar.bz2
openbsd-f376030ff7fe24f4ad44a56c2d8ba8796c9ab3f0.zip
We'll interpret a (void) cast on snprintf() to mean it's been verified that
truncation is either desirable, not an issue, or is detected and handled later ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/err')
-rw-r--r--src/lib/libcrypto/err/err.c8
-rw-r--r--src/lib/libcrypto/err/err_prn.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index 0672477cc8..c4192c6bfa 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -842,13 +842,13 @@ void ERR_error_string_n(unsigned long e, char *buf, size_t len)
842 rs=ERR_reason_error_string(e); 842 rs=ERR_reason_error_string(e);
843 843
844 if (ls == NULL) 844 if (ls == NULL)
845 (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l); 845 snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
846 if (fs == NULL) 846 if (fs == NULL)
847 (void) snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f); 847 snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
848 if (rs == NULL) 848 if (rs == NULL)
849 (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r); 849 snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
850 850
851 (void) snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf, 851 snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
852 fs?fs:fsbuf, rs?rs:rsbuf); 852 fs?fs:fsbuf, rs?rs:rsbuf);
853 if (strlen(buf) == len-1) 853 if (strlen(buf) == len-1)
854 { 854 {
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c
index 7374c0abe7..be4d5de2d2 100644
--- a/src/lib/libcrypto/err/err_prn.c
+++ b/src/lib/libcrypto/err/err_prn.c
@@ -79,7 +79,7 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
79 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) 79 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0)
80 { 80 {
81 ERR_error_string_n(l, buf, sizeof buf); 81 ERR_error_string_n(l, buf, sizeof buf);
82 (void) snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf, 82 snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
83 file, line, (flags & ERR_TXT_STRING) ? data : ""); 83 file, line, (flags & ERR_TXT_STRING) ? data : "");
84 if (cb(buf2, strlen(buf2), u) <= 0) 84 if (cb(buf2, strlen(buf2), u) <= 0)
85 break; /* abort outputting the error report */ 85 break; /* abort outputting the error report */