Update mxml-options.c

If the passed-in options are null, a segment error occurs when trying to access a member with a null pointer.
This commit is contained in:
钰棋 2024-06-14 09:47:56 +08:00 committed by GitHub
parent 804c4f4d92
commit 3727b95db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -538,7 +538,7 @@ _mxml_error(mxml_options_t *options, // I - Load/save options
va_end(ap); va_end(ap);
// And then display the error message... // And then display the error message...
if (options->error_cb) if (options && options->error_cb)
(options->error_cb)(options->error_cbdata, s); (options->error_cb)(options->error_cbdata, s);
else else
fprintf(stderr, "%s\n", s); fprintf(stderr, "%s\n", s);