3.0.2 / new bug in rlm_perl.c - perl script gets garbage in hv lists

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Mon Mar 24 17:21:11 CET 2014


Hello,


There is an issue with 3.0.2 rlm_perl.c

When I try to access the hash value pair lists in the perl script, I've got complete garbage.
For instance (output produced by Dumper):


>>> 'User-Name'
[
  'query=proxy-stat"@DªàCª@Dª ×ag1
                                 °Kª@Dª0!×aàCªPKªP ×aº1
                                                      °KªÞþ0!×a Á@@;×a$c
                                                                       ("°KªhDª@DªhDª°Kª¸KªÀÀ¥1,,îøh=
àyÑ}©Çh=,ðÑ}FëÈ93p
z®
sñÉ93÷zá
       °Y~`N ±ªP
                îøh=ðÑ}p
z®÷zá
~AòÉ93ûþÈ93÷zá
             ðÑ}@«¡Ë93
"3pþ
     Hk¥Ú}
{á        ðÑ}
{á
~{á
  þÊ930
ZÅ93{á
     ',

(...)



I checked the differences between 3.0.1 code.
In function perl_store_vps, I reverted the following lines to prior code:


Line 633:
				//av_push(av, newSVpv(buffer, truncate_len(len, sizeof(buffer))));
				//NCH:fix.
				av_push(av, newSVpv(buffer, len));


Line 643:
			//(void)hv_store(rad_hv, name, strlen(name), newSVpv(buffer, truncate_len(len, sizeof(buffer))), 0);
			//NCH fix:
			(void)hv_store(rad_hv, name, strlen(name), newSVpv(buffer, len), 0);



Now it works again.


Seems there's an issue with truncate_len, or how it's used.




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.



More information about the Freeradius-Devel mailing list