From 4a80c0540f0f9b3303919ee7209eedfac856a1af Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 6 Nov 2018 10:06:07 +0000 Subject: adopt sanitizer API These APIs are much like . Use them to fine-grain annotate the usage of our memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 2ff709b0b2..42f9b53148 100644 --- a/string.c +++ b/string.c @@ -803,6 +803,11 @@ VALUE rb_str_new_cstr(const char *ptr) { must_not_null(ptr); + /* rb_str_new_cstr() can take pointer from non-malloc-generated + * memory regions, and that cannot be detected by the MSAN. Just + * trust the programmer that the argument passed here is a sane C + * string. */ + __msan_unpoison_string(ptr); return rb_str_new(ptr, strlen(ptr)); } -- cgit v1.2.3