From: Kirill Yukhin <kyukhin@tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Make string to number conversions fail on NUL char
Date: Thu, 5 Mar 2020 10:49:39 +0300 [thread overview]
Message-ID: <20200305074939.f2ucx2acn2phm2kc@tarantool.org> (raw)
In-Reply-To: <62003dc4b5a3672d02c3ec599b5ecb65a557d6b5.1581635592.git.imun@tarantool.org>
Hello,
On 14 фев 02:57, Igor Munkin wrote:
> The routine used for conversion a string representation to number
> (lj_strscan_scan) doesn't respect the size of the given string/buffer.
> Such behaviour leads to the following results:
>
> | local a = tonumber("inf\x00imun") -- the result is 'inf'
> | local b = tonumber("\x36\x00\x80") -- the result is 6
>
> The behaviour described above is similar to the one vanila Lua 5.1 has:
>
> | $ ./lua -e 'print(_VERSION, tonumber("inf"..string.char(0).."imun"))'
> | Lua 5.1 inf
>
> However, the issue is fixed in Lua 5.2 and the results are the following:
> | $ ./lua -e 'print(_VERSION, tonumber("inf"..string.char(0).."imun"))'
> | Lua 5.2 nil
>
> The patch introduces additional parameter to lj_strscan_scan routine to
> detect whether there is nothing left after the null character.
>
> Relates to tarantool#4773
>
> Reported-by: Alexander Turenko <alexander.turenko@tarantool.org>
> Signed-off-by: Igor Munkin <imun@tarantool.org>
I've checked your patch inti tarantool/luajit repo and
bumped new version in 1.10, 2.2, 2.3 and master.
--
Regards, Kirill Yukhin
next prev parent reply other threads:[~2020-03-05 7:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 23:57 Igor Munkin
2020-02-14 0:07 ` Igor Munkin
2020-03-03 14:53 ` Sergey Ostanevich
2020-03-03 17:36 ` Igor Munkin
2020-03-05 7:49 ` Kirill Yukhin [this message]
2020-03-05 9:36 ` Igor Munkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200305074939.f2ucx2acn2phm2kc@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=imun@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit] Make string to number conversions fail on NUL char' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox