From c0eab6b4c47dee2610cf1b1bd9cb1cd7b92c5604 Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 6 Feb 2019 23:23:18 +0100 Subject: [PATCH] Don't crash if a component use NULL as error message argument. Replace it by a void string. [INTERPRETER] * BUG: Don't crash if a component use NULL as error message argument. Replace it by a void string. --- main/gbx/gb_error.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/gbx/gb_error.c b/main/gbx/gb_error.c index 4c073ccf7..d35db7823 100644 --- a/main/gbx/gb_error.c +++ b/main/gbx/gb_error.c @@ -313,7 +313,10 @@ static int get_message_length(const char *pattern, char *arg[], int narg) len = strlen(pattern) + narg; for (i = 0; i < narg; i++) - len += strlen(arg[i]); + { + if (arg[i]) + len += strlen(arg[i]); + } if (!EXEC_debug) len -= narg * 3;