[Tarantool-patches] [PATCH] cppcheck: src/lua/fiber.c null pointer dereference

Sergey Kaplun skaplun at tarantool.org
Thu Sep 24 14:31:35 MSK 2020


On 24.09.20, Alexander Turenko wrote:
> On Thu, Sep 24, 2020 at 02:16:20AM +0300, Alexander Turenko wrote:
<snipped>
> 
> Moved to https://github.com/tarantool/tarantool/issues/5326

I've added comment about this behaviour:

```
diff --git a/src/lua/fiber.c b/src/lua/fiber.c
index 1c7d9cdb6..efb0a4921 100644
--- a/src/lua/fiber.c
+++ b/src/lua/fiber.c
@@ -214,6 +214,11 @@ fiber_backtrace_cb(int frameno, void *frameret, const char *func, size_t offset,
 {
         struct lua_fiber_tb_ctx *tb_ctx = (struct lua_fiber_tb_ctx *)cb_ctx;
         struct lua_State *L = tb_ctx->L;
+        /*
+         * There is impossible to get func == NULL until
+         * https://github.com/tarantool/tarantool/issues/5326
+         * will not resolved, but is possible afterwards.
+         */
         if (func != NULL && strstr(func, "lj_BC_FUNCC") == func) {
                 /* We are in the LUA vm. */
                 lua_Debug ar;
```

You can see other fixes in [1]

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-September/019636.html

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list