From ac97d86f677b38c75074c7c2b0f2a6ade6d930e8 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 aff7bc02..87e4789b 100644 --- a/mx_mysql.c +++ b/mx_mysql.c @@ -945,6 +945,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);