From 57611240a972932ef26a13c6998a7fa90fd33371 Mon Sep 17 00:00:00 2001 From: dearblue Date: Thu, 24 Sep 2020 22:25:26 +0900 Subject: Prohibit string changes by "s"/"z" specifier of `mrb_get_args()` - The `s` specifier is a string pointer obtained without performing `mrb_str_modify()`, so it cannot be changed. - The `z` specifier cannot be changed because it is a string pointer obtained by `RSTRING_CSTR()` which returns `const char *`. --- mrbgems/mruby-io/src/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mrbgems/mruby-io') diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index d3c4b3885..53ed4b69d 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -557,7 +557,8 @@ mrb_file_s_readlink(mrb_state *mrb, mrb_value klass) { mrb_raise(mrb, E_NOTIMP_ERROR, "readlink is not supported on this platform"); return mrb_nil_value(); // unreachable #else - char *path, *buf, *tmp; + const char *path; + char *buf, *tmp; size_t bufsize = 100; ssize_t rc; mrb_value ret; -- cgit v1.2.3