ruby-changes:59018
From: Takashi <ko1@a...>
Date: Sun, 1 Dec 2019 19:00:30 +0900 (JST)
Subject: [ruby-changes:59018] 91af5542b5 (master): Fix a mistake excluding NULL in the end
https://git.ruby-lang.org/ruby.git/commit/?id=91af5542b5 From 91af5542b503054ea059b6c4faa5cd821784774a Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sun, 1 Dec 2019 02:00:08 -0800 Subject: Fix a mistake excluding NULL in the end diff --git a/mjit.c b/mjit.c index f062b4b..f0b66d3 100644 --- a/mjit.c +++ b/mjit.c @@ -730,10 +730,10 @@ split_flags(char *flags) https://github.com/ruby/ruby/blob/trunk/mjit.c#L730 next++; // skip space } } - buf[i] = NULL; - char **ret = xmalloc(sizeof(char **) * i); + char **ret = xmalloc(sizeof(char **) * (i + 1)); memcpy((void *)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/