
nnposter at users
Sep 16, 2008, 6:41 AM
Post #7 of 7
(2214 views)
Permalink
|
|
Re: Unpredictable behavior of uninitialized named arguments
[In reply to]
|
|
"Nicolas Pouvesle" wrote: > On Sep 15, 2008, at 6:10 AM, nnposter [at] users wrote: > > > >> IIRC, I added some code which printed a warning if a variable was > >> found > >> in an upper context, but I don't remember if it is present in any 2.2 > >> release. > >> > >>> As it stands now most of the X.509 functions are broken in 2.x. > >> > >> What do you mean by "broken"? > > > > As an example, der_decode() from kerberos_func.inc looks like this: > > > > function der_decode (data, pos) > > { > > ... > > if (isnull (pos)) > > j = 0; > > else > > j = pos; > > ... > > } > > > > This function is called by a number of parse_XXX() functions from > > x509_func.inc without specifying parameter "pos", i.e. relying on > > pos=0 by default. These functions are in turn called by other > > functions, such as parse_publickey_info() or > > parse_tbs_certificate(), that have their own "pos". This higher-up > > "pos" is then erroneously used by der_decode(). > > > ssl_ciphers.nasl and x509_func.inc have been developed to replace > ssl_ciphers.nes starting with Nessus 3.2.1 : > > if ( NASL_LEVEL < 3208 ) exit(0); > > So x509_func.inc is not intended to work with Nessus 2. It seems that by simply renaming these higher-up local "pos" variables I was able to make x509_func.inc work under 2.x. Is there a reason not to implement this change? (I will be happy to provide a patch.) A second question is regarding kerberos_func.inc: The origin of the problem is really the use of optional parameters in der_decode() from kerberos_func.inc so should we assume that kerberos_func.inc is also not intended for 2.x? Cheers, nnposter _______________________________________________ Plugins-writers mailing list Plugins-writers [at] list http://mail.nessus.org/mailman/listinfo/plugins-writers
|