From c75fef4cb61d46d0b448654ef85c326d13d97222 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 23 Apr 2020 18:27:25 +1000 Subject: Maybe fix that DB crash? --- src/sledjchisl/sledjchisl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sledjchisl') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index d7b57c3..263dd8e 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -1130,7 +1130,7 @@ W("Allocated %d %d inBinds for %s", i, req->inCount, req->sql); // 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_length = fld->length; + req->inBind[i].buffer_length = fld->length + 1; switch(fld->type) { case MYSQL_TYPE_TINY: @@ -1272,7 +1272,7 @@ W("Allocated %d %d outBinds for %s", i, req->outCount, req->sql); // For some gotchas about all of this binding bit. req->outBind[i].buffer_type = fld->type; req->outBind[i].buffer = xzalloc(fld->length + 1); // Note the + 1 is for string types, and a waste for the rest. - req->outBind[i].buffer_length = fld->length; + req->outBind[i].buffer_length = fld->length + 1; req->outBind[i].error = xzalloc(sizeof(my_bool)); req->outBind[i].is_null = xzalloc(sizeof(my_bool)); switch(fld->type) -- cgit v1.1