From 7edff9213893164ab14580791a4172eb13c9614a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 22 Mar 2024 01:37:00 +0100 Subject: fix oob write due to typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stack-use-after-return on address 0x1272255d6ad0 at pc 0x7ff7069e08a0 bp 0x00539fd7e4e0 sp 0x00539fd7e528 WRITE of size 1 at 0x1272255d6ad0 thread T0 at 0x7ff7069e089f floormat::tests::(anonymous namespace)::next_stepʹ(Magnum::Math::Vector2) (pathfinding.cpp:53) at 0x7ff7069dff1b floormat::tests::(anonymous namespace)::next_step(floormat::point, floormat::point) (pathfinding.cpp:89) at 0x7ff7069deaad floormat::tests::(anonymous namespace)::pf_test::update_pre(floormat::app&, floormat::Ns const&) (pathfinding.cpp:238) at 0x7ff7069cc1a1 floormat::app::tests_pre_update(floormat::Ns) (tests.cpp:52) at 0x7ff7069fd776 floormat::app::update(floormat::Ns) (update.cpp:280) at 0x7ff706a26b0b floormat::main_impl::do_update() (draw.cpp:45) at 0x7ff706a26f69 floormat::main_impl::drawEvent() (draw.cpp:63) at 0x7ff707658ca4 Magnum::Platform::Sdl2Application::mainLoopIteration() (Sdl2Application.cpp:1036) at 0x7ff7076564af Magnum::Platform::Sdl2Application::exec() (Sdl2Application.cpp:867) at 0x7ff706a2f084 floormat::main_impl::exec() (main-impl.cpp:21) at 0x7ff7067a29d7 floormat::app::exec() (app.cpp:62) at 0x7ff7067a62f6 floormat::app::run_from_argv(int, char const* const*) (app.cpp:148) at 0x7ff7067a66e4 main (app.cpp:162) at 0x7ff7067a1310 __tmainCRTStartup (crtexe.c:267) at 0x7ff7067a1365 .l_start (crtexe.c:188) at 0x7fff5bac7343 at 0x7fff5ca026b0 Address 0x1272255d6ad0 is located in stack of thread T0 at offset 208 in frame at 0x7ff706a3248f floormat::main_impl::pixel_to_tile(Magnum::Math::Vector2) const (projection.cpp:9) --- editor/tests/pathfinding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editor') diff --git a/editor/tests/pathfinding.cpp b/editor/tests/pathfinding.cpp index 928d7496..b33a71c0 100644 --- a/editor/tests/pathfinding.cpp +++ b/editor/tests/pathfinding.cpp @@ -50,7 +50,7 @@ constexpr step_s next_stepʹ(Vector2i vec_in) const auto major = vec[major_idx], minor = vec[minor_idx]; const auto num_axis_aligned = (uint32_t)Math::abs((int)major - (int)minor); auto axis_aligned = Vector2b{}; - axis_aligned[major] = 1; + axis_aligned[major_idx] = 1; return { num_axis_aligned, axis_aligned * signs }; } } -- cgit v1.2.3