mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 21:48:19 +00:00
Merge pull request #9131 from ChillerDragon/pr_fix_mysql_null_bind
Fix empty vector element access in mysql prepare
This commit is contained in:
commit
a9e52d2b7b
|
@ -331,8 +331,11 @@ bool CMysqlConnection::PrepareStatement(const char *pStmt, char *pError, int Err
|
||||||
unsigned NumParameters = mysql_stmt_param_count(m_pStmt.get());
|
unsigned NumParameters = mysql_stmt_param_count(m_pStmt.get());
|
||||||
m_vStmtParameters.resize(NumParameters);
|
m_vStmtParameters.resize(NumParameters);
|
||||||
m_vStmtParameterExtras.resize(NumParameters);
|
m_vStmtParameterExtras.resize(NumParameters);
|
||||||
|
if(NumParameters)
|
||||||
|
{
|
||||||
mem_zero(&m_vStmtParameters[0], sizeof(m_vStmtParameters[0]) * m_vStmtParameters.size());
|
mem_zero(&m_vStmtParameters[0], sizeof(m_vStmtParameters[0]) * m_vStmtParameters.size());
|
||||||
mem_zero(&m_vStmtParameterExtras[0], sizeof(m_vStmtParameterExtras[0]) * m_vStmtParameterExtras.size());
|
mem_zero(&m_vStmtParameterExtras[0], sizeof(m_vStmtParameterExtras[0]) * m_vStmtParameterExtras.size());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue