From c4b0945e9e524919924a516a93f9872c33b273a0 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 3 May 2022 11:20:00 +0200 Subject: [PATCH] mx_mxql: Initialize s->func When we run into a (very unlikely) early error condition, the error macros might output s->func. While glibc printf functions output "(null)" if NULL is passed to "%s", this is not guaranteed. For example, gcc transforms `printf("%s\n", ptr)` into `puts(ptr)`. --- mx_mysql.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mx_mysql.c b/mx_mysql.c index 2f80cd38..b537c16b 100644 --- a/mx_mysql.c +++ b/mx_mysql.c @@ -962,6 +962,7 @@ static int mx_mysql_statement_init(struct mx_mysql *mysql, struct mx_mysql_stmt s = mx_calloc_forever(1, sizeof(*s)); s->mysql = mysql; + s->func = ""; do { res = mx__mysql_stmt_init(s);