Mailing List Archive

Bug in function nasl_open_privileged_socket?
Hi,
I found a potential bug in nasl_open_privileged_socket function that
could make it running improperly.

Here is the function, and I made some comments on the right side:
static tree_cell * nasl_open_privileged_socket(lex_ctxt * lexic, int
proto)
{
int sport, current_sport = -1;
...

if(sport < 0) current_sport = 1023; <-----here should has an else
statement, like: "else current_sport = sport;", otherwise if sport>0,
the first line under tryagian below will always fail

...

tryagain :
if ( current_sport < 128 ) return NULL; <--------------here will
always fail if sport>0
e = set_socket_source_addr(sock, sport > 0 ? sport : current_sport--);

...
}


Please confirm if this is a bug or just my misunderstanding. Thanks!

Regards

Jingyu
Re: Bug in function nasl_open_privileged_socket? [ In reply to ]
On Jun 1, 2005, at 22:55, Jingyu Dong wrote:

> Hi,
> I found a potential bug in nasl_open_privileged_socket function that
> could make it running improperly.
>
>
> Please confirm if this is a bug or just my misunderstanding. Thanks!

Yes - it has been fixed in CVS some weeks ago and the fix will be in
2.2.5.