1 Commits
Author SHA1 Message Date
eunho87 5d4fffbb14 Guard against NULL return in mg_file_printf
mg_vmprintf() returns io.buf from a mg_iobuf that starts empty. When the
internal mg_iobuf_resize() allocation fails, the buffer is left NULL and
mg_vmprintf() returns NULL. mg_file_printf() passed that result straight
to strlen(data), dereferencing NULL on allocation failure.

Skip the write when mg_vmprintf() returns NULL and return false, matching
how the rest of the codebase checks mg_calloc()/allocation results.
2026-09-15 10:50:14 +09:00