summaryrefslogtreecommitdiff
path: root/lib/libcrypto/err
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-26 15:24:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-26 15:24:09 +0000
commitcc9317ca81739b5c5fd94354182e54fc1a46b305 (patch)
treeb4987fce139a120e2f7ecdcf73ae538b2052b6df /lib/libcrypto/err
parentd33024406bef1757523e985b8c97875b936adf6e (diff)
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/err')
-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