mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
string.c (mrb_string_value_cstr): RSTR_PTR(s) may be NULL; fix #6067
This commit is contained in:
@@ -2436,6 +2436,7 @@ mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr)
|
||||
check_null_byte(mrb, ps);
|
||||
p = RSTR_PTR(ps);
|
||||
len = RSTR_LEN(ps);
|
||||
if (p == NULL) return "";
|
||||
if (p[len] == '\0') {
|
||||
return p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user