[Tarantool-patches] [PATCH luajit] Fix zero stripping in %g number formatting.

Igor Munkin imun at tarantool.org
Thu Feb 15 16:46:13 MSK 2024


Sergey,

I've checked the patchset into all long-term branches in
tarantool/luajit and bumped a new version in master, release/3.0 and
release/2.11.

On 30.01.24, Sergey Kaplun via Tarantool-patches wrote:
> From: Mike Pall <mike>
> 
> Reported by pwnhacker0x18.
> 
> (cherry picked from commit 343ce0edaf3906a62022936175b2f5410024cbfc)
> 
> In the situation when the precision (`prec`) and amount of digits
> (`hilen`) for the decimal representation are the same and `ndhi` == 0,
> the `ndlo` part will become 64 (the size of the `nd` stack buffer), and
> the overflow occurs.
> 
> This patch adds the corresponding mask (0x3f == 63) for the `ndlo`
> incrementation result.
> 
> Sergey Kaplun:
> * added the description and the test for the problem
> 
> Part of tarantool/tarantool#9595
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1149-g-number-formating
> Tarantool PR: https://github.com/tarantool/tarantool/pull/9633
> 
> The test <app-tap/gh-2717-no-quit-sigint.test.lua> fails on M1 with the
> timeout (see the example [1]). This fail is patch-unrelated, since I've
> obscured this failure even for the branch without sources changes (tests
> only).
> 
> Related Issues:
> * https://github.com/LuaJIT/LuaJIT/issues/1149
> * https://github.com/tarantool/tarantool/issues/9595
> 
> [1]: https://github.com/tarantool/luajit/actions/runs/7712549489/job/21020513973#step:8:5522
> 
> Duration of failed tests (seconds):
> * 60.54 app-tap/gh-2717-no-quit-sigint.test.lua
> 
>  src/lj_strfmt_num.c                           |  3 ++-
>  .../lj-1149-g-number-formating-bufov.test.lua | 20 +++++++++++++++++++
>  2 files changed, 22 insertions(+), 1 deletion(-)
>  create mode 100644 test/tarantool-tests/lj-1149-g-number-formating-bufov.test.lua
> 

<snipped>

> -- 
> 2.43.0
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list