error.c (mrb_vformat): prevent SEGV from %s with NULL

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-05-21 09:52:10 +09:00
parent 1726b61481
commit 77d08772a5
+1
View File
@@ -329,6 +329,7 @@ mrb_vformat(mrb_state *mrb, const char *format, va_list ap)
goto L_cat_obj;
case 's':
chars = va_arg(ap, char*);
if (chars == NULL) chars = "(null)";
len = strlen(chars);
goto L_cat;
case 't':