When processing a $INCLUDE directive, the following code in
pairlist_read() of main/files.c may cause any accumulated
pair information to be lost when the recursion of the function
returns a NULL to its PAIR_LIST **list argument.  This can
happen, for example, when the users file has a $INCLUDE that
names an empty file and other pairs or $INCLUDE directives
follow.

The suspect code appears in files.c at:

0.8.1, line 223:
0.9.0, line 184:

        last = t;
        while (last && last->next)
                last = last->next;

If t == NULL, then last will become NULL.  If any pairs or any
$INCLUDE follow the $INCLUDE that caused pairlist_read() to set
t == NULL, all pairs recorded prior to the $INCLUDE of the empty
file will be lost.

A fix that appears to work that has been tested under 0.8.1 is:

        while (t && t->next)
                t = t->next;
        if (t)
                last = t;

Vic Abell

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to