[Openvas-devel] [Openvas-commits] r1103 -trunk/openvas-libnasl/nasl

Chandrashekhar B bchandra at secpod.com
Wed Aug 6 12:35:56 CEST 2008


When we call open_sock_udp(port), fd value returned is 4 and upwards on
multiple calls. So, when nasl_close_socket() is called, it justs returns
without closing the local port bound to the socket, when the fd value is 4.
A minor issue. 

Chandra.

-----Original Message-----
From: openvas-devel-bounces at wald.intevation.org
[mailto:openvas-devel-bounces at wald.intevation.org] On Behalf Of Bernhard
Herzog
Sent: Wednesday, August 06, 2008 3:39 PM
To: openvas-devel at wald.intevation.org
Subject: Re: [Openvas-devel] [Openvas-commits] r1103
-trunk/openvas-libnasl/nasl

scm-commit at wald.intevation.org writes:

> Fixed an issue with UDP socket close in nasl_close_socket
[...]
> --- trunk/openvas-libnasl/nasl/nasl_socket.c	2008-08-04 09:16:50 UTC (rev
1102)
> +++ trunk/openvas-libnasl/nasl/nasl_socket.c	2008-08-06 09:41:14 UTC (rev
1103)
> @@ -612,7 +612,7 @@
>   int e;
>   
>   soc = get_int_var_by_num(lexic, 0, -1);
> - if(soc <= 4)
> + if(soc < 4)
>  	{
>   	 nasl_perror(lexic, "close(): invalid argument\n");
>  	 return NULL;

This seems a bit strange.  What problem does that fix, exactly?  And
what's the relevance of the number 4 here?  Why don't the other NASL
functions that accept sockets as parameters contain similar checks?

   Bernhard

-- 
Bernhard Herzog                              Intevation GmbH, Osnabrück
Amtsgericht Osnabrück, HR B 18998             http://www.intevation.de/
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
_______________________________________________
Openvas-devel mailing list
Openvas-devel at wald.intevation.org
http://lists.wald.intevation.org/mailman/listinfo/openvas-devel




More information about the Openvas-devel mailing list