ruby-changes:59046
From: Yusuke <ko1@a...>
Date: Tue, 3 Dec 2019 08:04:44 +0900 (JST)
Subject: [ruby-changes:59046] 8bddf1bc9b (master): mjit.c: fix a mismatch of malloc'ed type
https://git.ruby-lang.org/ruby.git/commit/?id=8bddf1bc9b From 8bddf1bc9bdd1db7ce2e3fec15f2f06ff355b0a7 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Tue, 3 Dec 2019 08:02:38 +0900 Subject: mjit.c: fix a mismatch of malloc'ed type Coverity Scan found this issue. diff --git a/mjit.c b/mjit.c index d8e431a..33abfbe 100644 --- a/mjit.c +++ b/mjit.c @@ -731,8 +731,8 @@ split_flags(const char *flags) https://github.com/ruby/ruby/blob/trunk/mjit.c#L731 } } - char **ret = xmalloc(sizeof(char **) * (i + 1)); - memcpy((void *)ret, buf, sizeof(char **) * i); + char **ret = xmalloc(sizeof(char *) * (i + 1)); + memcpy(ret, buf, sizeof(char *) * i); ret[i] = NULL; return ret; } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/