From e13ab6689d9f5d7232fe9e619a6c9f633ff8120e Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 3 Apr 2015 07:56:45 +0300 Subject: [PATCH] Fixed coverity defects. --- server/modules/filter/dbfwfilter.c | 3 ++- server/modules/routing/schemarouter/schemarouter.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/modules/filter/dbfwfilter.c b/server/modules/filter/dbfwfilter.c index 0ad3e9150..b200e5580 100644 --- a/server/modules/filter/dbfwfilter.c +++ b/server/modules/filter/dbfwfilter.c @@ -1355,13 +1355,14 @@ createInstance(char **options, FILTER_PARAMETER **params) free(filename); /**Apply the rules to users*/ + ptr = my_instance->userstrings; + if(ptr == NULL) { skygw_log_write(LOGFILE_ERROR,"dbfwfilter: No 'users' line found."); err = true; goto retblock; } - ptr = my_instance->userstrings; while(ptr){ diff --git a/server/modules/routing/schemarouter/schemarouter.c b/server/modules/routing/schemarouter/schemarouter.c index c7842c222..b9ecb126d 100644 --- a/server/modules/routing/schemarouter/schemarouter.c +++ b/server/modules/routing/schemarouter/schemarouter.c @@ -4167,7 +4167,7 @@ static bool change_current_db( goto reply_error; } - strcpy(rses->rses_mysql_session->db,tok); + strncpy(rses->rses_mysql_session->db,tok,MYSQL_DATABASE_MAXLEN); free(query); query = NULL;