Hi List,

I'm currently using freeradius 1.0.0 on Solaris 9, and I've come across
a problem with regexec() in the paircmp() function of valuepair.c.

According to the man page for paircmp on Solaris 9:

     int regexec(const regex_t *preg, const char *string,
                 size_t nmatch, regmatch_t pmatch[], int eflags);

     If nmatch is ... [non-zero] the pmatch argument must point to an
     array with at least nmatch elements. ... Offsets  in  pmatch[0]
     identify the substring that corresponds to the entire regular
     expression. Unused elements of pmatch up to pmatch[nmatch-1] will
     be filled with -1. 


However, in valuepair.c we have:

     regmatch_t rxmatch[9];
     compare = regexec(&reg, (char *)auth_item->strvalue,
                       16, rxmatch, 0);

Ie nmatch is 16, but the size of the pmatch array is only 9.

This causes a bus error in the call to regfree() when I try to match a
regular expression is users.

The problem is corrected when I make rxmatch 17 elements rather than 9,
corresponding to the nmatch value 16.

Is this a peculiar problem to Solaris 9, or have others had this issue?

I also notice that this code has changed since 0.9.3.

Regards,
Michael
 

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

Reply via email to