diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index 54a9e5968..022523488 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -674,7 +674,7 @@ static int logmanager_write_log( if (use_valist) { vsnprintf(wp+timestamp_len, safe_str_len, str, valist); } else { - snprintf(wp+timestamp_len, safe_str_len, str); + snprintf(wp+timestamp_len, safe_str_len, "%s", str); } /** write to syslog */ @@ -682,11 +682,11 @@ static int logmanager_write_log( { switch(id) { case LOGFILE_ERROR: - syslog(LOG_ERR, wp+timestamp_len); + syslog(LOG_ERR, "%s", wp+timestamp_len); break; case LOGFILE_MESSAGE: - syslog(LOG_NOTICE, wp+timestamp_len); + syslog(LOG_NOTICE, "%s", wp+timestamp_len); break; default: @@ -742,7 +742,7 @@ static int logmanager_write_log( * Copy original string from block buffer to * other logs' block buffers. */ - snprintf(wp_c, timestamp_len+str_len, wp); + snprintf(wp_c, timestamp_len+str_len, "%s", wp); /** remove double line feed */ if (wp_c[timestamp_len-1+str_len-2] == '\n') diff --git a/makefile.inc b/makefile.inc index a0615b797..657ebf849 100644 --- a/makefile.inc +++ b/makefile.inc @@ -22,6 +22,7 @@ ifdef DYNLIB LIB := libmysqld.so.18 endif +# -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC CFLAGS := $(CFLAGS) -Wall LDLIBS := $(LDLIBS) -pthread @@ -32,7 +33,7 @@ CPP_LDLIBS := -lstdc++ # Compiler flags, httpd arguments and debugger options # ifdef DEBUG - DEBUG_FLAGS := -DSS_DEBUG +DEBUG_FLAGS := -DSS_DEBUG -pipe -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4 -fPIC CFLAGS := $(CFLAGS) -ggdb -O0 -pthread $(DEBUG_FLAGS) endif