From 8a9caff694a8514dca845b1b60057f783ba685f7 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 23 Apr 2020 01:29:42 +1000 Subject: Attempt to work around what might be a bug in MariaDB. Getting lots of - Invalid write of size 1 Address 0xfad1f44 is 0 bytes after a block of size 36 alloc'd Always 36. --- src/sledjchisl/sledjchisl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sledjchisl') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index c4126b3..ab5c707 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -1126,7 +1126,7 @@ W("Allocated %d %d inBinds for %s", i, req->inCount, req->sql); // https://blog.cotten.io/a-taste-of-mysql-in-c-87c5de84a31d?gi=ab3dd1425b29 // For some gotchas about all of this binding bit. req->inBind[i].buffer_type = fld->type; - req->inBind[i].buffer = xzalloc(fld->length) + 1; // Note the + 1 is for string types, and a waste for the rest. + req->inBind[i].buffer = xzalloc(fld->length) + 4; // Note the + 1 is for string types, and a waste for the rest. +4 to work around a MariaDB bug? req->inBind[i].buffer_length = fld->length; switch(fld->type) { -- cgit v1.1