Fixes to Coverity defects 84879 84878 72752 72742

This commit is contained in:
Markus Makela
2014-12-15 06:12:40 +02:00
parent a4968f2521
commit 04a92e40df
4 changed files with 10 additions and 8 deletions

View File

@ -3807,7 +3807,8 @@ static bool execute_sescmd_in_backend(
tmpbuf = scur->scmd_cur_cmd->my_sescmd_buf;
qlen = MYSQL_GET_PACKET_LEN((unsigned char*)tmpbuf->start);
memset(data->db,0,MYSQL_DATABASE_MAXLEN+1);
strncpy(data->db,tmpbuf->start+5,qlen - 1);
if(qlen > 0)
strncpy(data->db,tmpbuf->start+5,qlen - 1);
}
/** Fallthrough */
case MYSQL_COM_QUERY: