admin管理员组文章数量:1312816
Good Morning,
I'm experiencing constant CWE-89 errors no matter how I refactor the following code below especially this line get's flagged (the fill):
sqlAdpt.Fill(dtblData);
I tried using ExecuteNonQuery, ExecuteScalar and some other methods and still getting this error with Veracode.
Please advise how to fix so that Veracode doesn't flag it.
public DataTable GetFYLocationsBySystemID(string query, ref string strErrorMsg)
{
SqlConnection sqlCon = new SqlConnection();
SqlDataAdapter sqlAdpt = new SqlDataAdapter();
SqlCommand sqlComm = new SqlCommand();
DataTable dtblData = new DataTable();
try
{
sqlCon = new SqlConnection(_strSqlString);
sqlComm = new SqlCommand(query, sqlCon);
sqlComm.CommandType = CommandType.Text;
sqlAdpt.SelectCommand = sqlComm;
sqlAdpt.Fill(dtblData);
return dtblData;
}
catch (Exception ex)
{
strErrorMsg = ex.Message;
return null;
}
finally
{
sqlCon.Close();
sqlCon.Dispose();
sqlComm.Dispose();
}
}
Thanks
本文标签: Why am I getting Constant CWE89 Error39s in VeracodeStack Overflow
版权声明:本文标题:Why am I getting Constant CWE-89 Error's in Veracode - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741916297a2404753.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论