[3024] in Kerberos-V5-bugs

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

krb5-libs/679: setjmp() bug in prompter.c

daemon@ATHENA.MIT.EDU (fcusack@iconnet.net)
Mon Dec 28 12:45:15 1998

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: krb5-unassigned@RT-11.MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU, fcusack@iconnet.net
Date: Mon, 28 Dec 1998 12:45:54 -0500 (EST)
From: fcusack@iconnet.net
Reply-To: fcusack@iconnet.net
To: krb5-bugs@MIT.EDU
Cc: fcusack@iconnet.net


>Number:         679
>Category:       krb5-libs
>Synopsis:       POSIX says automatic vars are undefined after setjmp()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    krb5-unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Mon Dec 28 12:45:01 EST 1998
>Last-Modified:
>Originator:     Frank Cusack
>Organization:
Icon CMT Corp.
>Release:        krb5-current-19981119
>Environment:
Unix
System: SunOS ratbert 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

>Description:
	OK, I don't know if it's POSIX that says it, but after longjmp(),
	automatic vars are undefined. In lib/krb5/os/prompter.c,
	krb5_prompter_posix(), ointrfunc *should* be a global, volatile,
	or static var to get around this (signal handler gets reset
	to ointrfunc when krb5_prompter_posix() returns, possibly
	after an interrupt).

	The fix below just makes it a global.
>How-To-Repeat:
>Fix:
Index: prompter.c
===================================================================
RCS file: /icon/d04/cvsroot/3rd-party/krb5-19981119/lib/krb5/os/prompter.c,v
retrieving revision 1.2
diff -u -r1.2 prompter.c
--- prompter.c	1998/11/25 06:50:50	1.2
+++ prompter.c	1998/12/28 17:35:22
@@ -13,6 +13,7 @@
 #endif /* ECHO_PASSWORD */
 
 static jmp_buf pwd_jump;
+static krb5_sigtype (*ointrfunc)();
 
 static krb5_sigtype
 intr_routine(signo)
@@ -34,7 +35,6 @@
 
     register char *ptr;
     int scratchchar;
-    krb5_sigtype (*ointrfunc)();
     krb5_error_code errcode;
     int i;
 #ifndef ECHO_PASSWORD
>Audit-Trail:
>Unformatted:

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