From f6cdaa96c03ad09c41b30baa66cccb512caef4dc Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 21 Nov 2006 19:19:09 +0000 Subject: [PATCH] Use error table to determine if errors should be loaded. --- CHANGES | 4 ++++ util/mkerr.pl | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 4b5a9d3b22..008f259b0d 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes between 0.9.7l and 0.9.7m [xx XXX xxxx] + *) Load error codes if they are not already present instead of using a + static variable. This allows them to be cleanly unloaded and reloaded. + [Steve Henson] + Changes between 0.9.7k and 0.9.7l [28 Sep 2006] *) Introduce limits to prevent malicious keys being able to diff --git a/util/mkerr.pl b/util/mkerr.pl index 9678514604..4171e0c98c 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl @@ -422,7 +422,7 @@ EOF print OUT <<"EOF"; /* $cfile */ /* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -536,17 +536,14 @@ if($static) { ${staticloader}void ERR_load_${lib}_strings(void) { - static int init=1; +#ifndef OPENSSL_NO_ERR - if (init) + if (ERR_func_error_string(${lib}_str_functs[0].error) == NULL) { - init=0; -#ifndef OPENSSL_NO_ERR ERR_load_strings($load_errcode,${lib}_str_functs); ERR_load_strings($load_errcode,${lib}_str_reasons); -#endif - } +#endif } EOF } else { -- 2.25.1