From 8ceff8b56cc640399d35dcec73fa58bdc6425440 Mon Sep 17 00:00:00 2001 From: Christopher Troup Date: Fri, 19 May 2017 09:28:21 -0400 Subject: [PATCH] Make sure we're not hitting uninitialized memory that happens to match prefix --- lib/mysql_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 5b30572c1..5978bdefa 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -123,7 +123,7 @@ bool MySQL_Connection_userinfo::set_schemaname(char *_new, int l) { if (schemaname) { _l=strlen(schemaname); // bug fix for #609 } - if ((schemaname==NULL) || (strncmp(_new,schemaname, (l > _l ? l : _l) ))) { + if ((schemaname==NULL) || (l != _l) || (strncmp(_new,schemaname, l ))) { if (schemaname) { free(schemaname); schemaname=NULL;