Possible bug in rlm_counter (v3)

Marco Marino marino.mrc at gmail.com
Wed Feb 26 11:31:25 CET 2014


res=check_vp->vp_integer - counter.user_counter; (line 804)
So, if we declare
unsigned int res;
probably it never goes in the "else" condition (there is a casting
problem!). But res should be "int", because res often is negative (and this
is right).
In the version 2 of this counter, res is int and it works. In version 3 res
is unsigned int and not works (User never reach its maximum daily session
time).

MM


2014-02-26 10:58 GMT+01:00 <A.L.M.Buxey at lboro.ac.uk>:

> Hi,
>
> >    res cannot be an unsigned int. It should be an int because this
> condition
> >    ->
> https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/src/modules/rlm_counter/rlm_counter.c#L805
> >    never can be false.
>
> thats a condition that checks IF res > 0
>
> ...so res COULD be less than 0 - who knows what random value might be
> assigned to it be some
> wierd policy or NAS config?  ;-)
>
> alan
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/devel.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20140226/f1d127d1/attachment.html>


More information about the Freeradius-Devel mailing list