[Kamailio-Devel] allow_address bug?

Vadim Berezniker VadimB at nbsvoice.com
Fri Aug 8 13:08:38 CEST 2008


Not quite. There's the following line in address.c:
if (inet_aton(xl_val.rs.s, &addr_struct) ...

xl_val.rs.len is not necessarily equal to strlen(xl_val.rs.s), right?

In my particular case (using $rd), there's additional data after the
first len bytes which is not ignored.

Unless I'm mistaken somewhere above, it's just a matter of copying the
len bytes to a new string and null terminating it.

I was able to work around it in my script by doing

$var(ip) = $rd;
allow_address("$var(ip)", "$rp")

-----Original Message-----
From: Juha Heinanen [mailto:jh at tutpro.com] 
Sent: Friday, August 08, 2008 1:24 AM
To: Vadim Berezniker
Cc: devel
Subject: [Kamailio-Devel] allow_address bug?

Vadim Berezniker writes:

 > in the permissions module, the allow_address function passes the
value  > of the parameter variable to inet_aton but it doesn't respect
"len" of  > the string.
 >
 > i call the function as
 > allow_address("$rd", "$rp")
 >
 > since it doesnt respect the length of the string, it ends up calling
> inet_aton with ip + port

are you saying that allow_address should check if $rp has null value?

currently allow_address function assumes that port_pvar arg has a real
port value.

-- juha



More information about the Devel mailing list