krb5 commit [krb5-1.11]: Avoid assertion failure in error_message
Tom Yu
tlyu at mit.edu
Fri Feb 6 17:26:40 EST 2015
https://github.com/krb5/krb5/commit/14d6549b53e008fe3b2b1d0e480162b678dd9962
commit 14d6549b53e008fe3b2b1d0e480162b678dd9962
Author: Greg Hudson <ghudson at mit.edu>
Date: Thu Jan 16 11:32:10 2014 -0500
Avoid assertion failure in error_message
r17942 added a call to get_thread_buffer in the first part of
error_message, prior to the call to com_err_initialize. This can
cause an assertion failure from k5_getspecific if error_message is
called on a system error before any other com_err functions are
called. Move the initialization call earlier to prevent this.
(back ported from 6bdaa746fec1cf29adcbe5b8e65c4b8993770b84)
ticket: 8078 (new)
version_fixed: 1.11.6
status: resolved
src/util/et/error_message.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c
index 01f2c03..77805da 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -123,6 +123,9 @@ error_message(long code)
const struct error_table *table;
int merr;
+ if (CALL_INIT_FUNCTION(com_err_initialize))
+ return 0;
+
l_offset = (unsigned long)code & ((1<<ERRCODE_RANGE)-1);
offset = l_offset;
table_num = ((unsigned long)code - l_offset) & ERRCODE_MAX;
@@ -157,8 +160,6 @@ error_message(long code)
goto oops;
}
- if (CALL_INIT_FUNCTION(com_err_initialize))
- return 0;
merr = k5_mutex_lock(&et_list_lock);
if (merr)
goto oops;
More information about the cvs-krb5
mailing list