summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-06-26 15:24:08 +0000
committerderaadt <deraadt@openbsd.org>2014-06-26 15:24:08 +0000
commitaacf3153b6b62fa00dd72c76cfd767f8fc9f7052 (patch)
treece35f07cc0449917af581838a3f23035a3d06001 /lib/libcrypto
parentfix HD() misuse; from brent cook (diff)
downloadwireguard-openbsd-aacf3153b6b62fa00dd72c76cfd767f8fc9f7052.tar.xz
wireguard-openbsd-aacf3153b6b62fa00dd72c76cfd767f8fc9f7052.zip
save errno in ERR_put_error(), so that SYSerr doesn't have any accidental
cases where errno can be trashed. ok jsing
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/err/err.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c
index 2f19dc276b1..4ea756003ad 100644
--- a/lib/libcrypto/err/err.c
+++ b/lib/libcrypto/err/err.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: err.c,v 1.33 2014/06/12 15:49:29 deraadt Exp $ */
+/* $OpenBSD: err.c,v 1.34 2014/06/26 15:24:08 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -702,6 +702,7 @@ void
ERR_put_error(int lib, int func, int reason, const char *file, int line)
{
ERR_STATE *es;
+ int save_errno = errno;
es = ERR_get_state();
@@ -713,6 +714,7 @@ ERR_put_error(int lib, int func, int reason, const char *file, int line)
es->err_file[es->top] = file;
es->err_line[es->top] = line;
err_clear_data(es, es->top);
+ save_errno = errno;
}
void