[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnu-radius-bug
Subject:    [Bug-gnu-radius] Bugfix: SEGFAULT in case of incomplete naslist
From:       Maurice Makaay <Maurice.Makaay () internl ! net>
Date:       2003-11-20 12:12:02
[Download RAW message or body]

Hi,

If you do not specify the nastype in the naslist file, there's a possibility
that the radiusd will crash. If you specify:

<ipaddr>...whitespace...<nickname>...whitespace...

things will be fine, but the following will cause an error to occur:

<ipaddr>...whitespace...<nickname>

>From the source (lib/nas.c) I get the impression that the nastype may be
omitted, because there's a fallback mechanism in there:

read_naslist_entry(void *unused ARG_UNUSED, int fc, char **fv, LOCUS *loc)
{
	----8<---- snapped some code -----
        if (fv[2][0] == 0)
                STRING_COPY(nas.nastype, "true");
        else
                STRING_COPY(nas.nastype, fv[2]);

If no whitespace is used after the nickname, fv[2] will be NULL and the
check for fv[2][0] being 0 makes no sense anymore. The problem can be
corrected by changing the if statement to:

        if (fv[2] == NULL || fv[2][0] == 0)


Regards,

-- Maurice Makaay


_______________________________________________
Bug-gnu-radius mailing list
Bug-gnu-radius@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-radius
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic