Nmap Development mailing list archives

Re: Completed Lua 5.3 upgrade!


From: Patrick Donnelly <batrick () batbytes com>
Date: Sat, 18 Jun 2016 21:22:51 -0400

On Sat, Jun 18, 2016 at 1:18 PM, Patrick Donnelly <batrick () batbytes com> wrote:
On Sat, Jun 18, 2016 at 12:00 PM, Daniel Miller <bonsaiviking () gmail com> wrote:
Patrick,

I found another one. I'm bringing these all up on the list so we have a
record of the kinds of bugs that can happen in a Lua version upgrade. In
ntp-date.nse, we calculate a timestamp as a floating-point number, then pass
it via stdnse.format_timestamp to os.date, which expects an integer. One way
to fix this would be to ensure it's an integer before we pass it in, but
maybe we should use math.floor to clamp it down to an integer within
stdnse.format_timestamp? What do you think?

Oh, that's a good point. I will go through the C functions that take
an integer argument using [1] or [2] and make sure we are passing
integers where expected.

Here's the ones I found:
https://github.com/batrick/nmap/commit/622749b293d9e9d9103cc2e911412190464b54af

I looked through all the functions which may take an integer argument
in Lua. I think I spotted most if not all of the potential issues.

-- 
Patrick Donnelly
_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: