[28392] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit [krb5-1.12]: Avoid assertion failure in error_message

daemon@ATHENA.MIT.EDU (Tom Yu)
Thu Jun 26 16:06:39 2014

Date: Thu, 26 Jun 2014 16:06:31 -0400
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201406262006.s5QK6Vnj004686@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/b1ace054ae9699b049ad1f47f5971a22bd3137ad
commit b1ace054ae9699b049ad1f47f5971a22bd3137ad
Author: Greg Hudson <ghudson@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.
    
    (cherry picked from commit 6bdaa746fec1cf29adcbe5b8e65c4b8993770b84)
    
    ticket: 7822
    version_fixed: 1.12.2
    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 50ede70..fb72396 100644
--- a/src/util/et/error_message.c
+++ b/src/util/et/error_message.c
@@ -121,6 +121,9 @@ error_message(long code)
     char *cp, *cp1;
     const struct error_table *table;
 
+    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;
@@ -155,8 +158,6 @@ error_message(long code)
         goto oops;
     }
 
-    if (CALL_INIT_FUNCTION(com_err_initialize))
-        return 0;
     k5_mutex_lock(&et_list_lock);
     dprintf(("scanning list for %x\n", table_num));
     for (e = et_list; e != NULL; e = e->next) {
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post