[2630] in Kerberos-V5-bugs

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

krb5-admin/341: kdb5_util loadv4 segfaults when stash file defaulted

daemon@ATHENA.MIT.EDU (John C. Hayward)
Tue Jan 14 00:32:44 1997

Resent-From: gnats@rt-11.MIT.EDU (GNATS Management)
Resent-To: bjaspan@MIT.EDU
Resent-Reply-To: krb5-bugs@MIT.EDU,
        "John C. Hayward" <John.C.Hayward@wheaton.edu>
Date: Mon, 13 Jan 1997 23:19:45 -0600 (CST)
From: "John C. Hayward" <John.C.Hayward@wheaton.edu>
To: krb-bugs@MIT.EDU


>Number:         341
>Category:       krb5-admin
>Synopsis:       kdb5_util load_v4 with default stash file causes segmentation fault
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bjaspan
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Jan 14 00:32:00 EST 1997
>Last-Modified:
>Originator:     John Hayward
>Organization:
Wheaton College
>Release:        1.0
>Environment:
System: NetBSD johnh.wheaton.edu 1.2B NetBSD 1.2B (JOHNH) #0: Thu Nov 14 23:43:13 PST 1996 johnh@johnhnew.wheaton.edu:/usr/src/sys/arch/i386/compile/JOHNH i386


>Description:
	When attempting to do a kdb5_util load_v4 without a stash file the
kdb5_util causes a segmentation fault.  
>How-To-Repeat:
        Do a kdb5_util load_v4 without configuring a stash file or specifing
a stash file as the command line option.  I believe the stash file involved
is the kerberos 5 stash file.
>Fix:
        Line 195 of loadv4.c calls strdup with NULL argument.  On NetBSD
strdup calls strlen with this argument which causes a segmentation fault.
I was able to verify under Ultrix 4.4 that passing a NULL argument to 
strlen also causes a segmentation fault.  While I am not an expert on
what strdup should do with a NULL argument the following replacement of
Line 195 of loadv4.c fixed the problem for me:

    stash_file = global_params.stash_file ?
                     strdup(global_params.stash_file) : NULL;  

        It may be that if stash_file is explicitly configured and/or if
the stash file is specified on the command line that 
global_params.stash_file may not be NULL but I did not check this out.  It
might be a work around for those without source.


>Audit-Trail:
>Unformatted:
X-send-pr-version: 3.99



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