[master] a value of type uint64 in configuration cannot be specified as hex

classic Classic list List threaded Threaded
2 messages Options
| Threaded
Open this post in threaded view
|

[master] a value of type uint64 in configuration cannot be specified as hex

Devel mailing list
Cf. file cf_parse.c (at line 286 of current HEAD):

        case FR_TYPE_UINT64:
                *(uint64_t *)out = strtoull(cp->value, NULL, 10);

Function strtoull is called with "base" = 10, which means we cannot have an input value "0x..." (it is converted to 0).

This is not consistent with other types such as uint32, where this is allowed ("base" = 0).
I think this might not be the intended behaviour. Could you please check ?

Thanks!


Regards,
Nicolas.

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
| Threaded
Open this post in threaded view
|

Re: [master] a value of type uint64 in configuration cannot be specified as hex

Alan DeKok-2
On Aug 12, 2019, at 9:38 AM, Chaigneau, Nicolas via Freeradius-Devel <[hidden email]> wrote:

>
> Cf. file cf_parse.c (at line 286 of current HEAD):
>
> case FR_TYPE_UINT64:
> *(uint64_t *)out = strtoull(cp->value, NULL, 10);
>
> Function strtoull is called with "base" = 10, which means we cannot have an input value "0x..." (it is converted to 0).
>
> This is not consistent with other types such as uint32, where this is allowed ("base" = 0).
> I think this might not be the intended behaviour. Could you please check ?

  I think it's fine to allow "0x...".  I'll push a fix.

  Alan DeKok.


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