Re: [NASL2] Metaphysical question on null values

Thomas Reinke <[email protected]>
Newsgroups gmane.comp.security.nessus.devel
Message-ID <[email protected]>
Michel Arboi wrote:
> NASL2 knows about uninitialized variables and have a NULL constant.
> 
> The code about addition, substraction and array indexing was rather
> logical : adding or substracting anything to / from an undefined value
> is undefined, and accessing an array element with an undefined index
> is undefined too.
> However, all this is silent and can be badly surprising.
> So... Either we shout every time we try such an operation, or we
> consider those undefined values as 0, at least for + - and [ ]
> I was ready to vote for the 2nd option and started modifying the code,
> but is this _really_ wise?
> 

Trade off _wise_ with ease of use.  I think it is reasonable
for ease of use to consider NULL another 'type' that is cast
appropriately when used to do operations such as string
concatenation and numerical operations.

If uncomfortable, consider making it a configurable option
(ala PHP) and then set it to the one you want for the
main Nessus project.

Thomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.