mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-16 12:29:00 -04:00
[EGD-6947] Fix SQL vulnerabilities
These were potential security holes allowing SQL injections.
This commit is contained in:
committed by
Wiktor S. Ovalle Correa
parent
30ae0e08ca
commit
fca0452802
@@ -125,7 +125,7 @@ std::pair<std::vector<NotesTableRow>, int> NotesTable::getByText(const std::stri
|
||||
{
|
||||
|
||||
unsigned int count = 0;
|
||||
auto queryRet = db->query("SELECT COUNT(*), INSTR(snippet,'%s') pos FROM notes WHERE pos > 0;", text.c_str());
|
||||
auto queryRet = db->query("SELECT COUNT(*), INSTR(snippet,'%q') pos FROM notes WHERE pos > 0;", text.c_str());
|
||||
if (queryRet && queryRet->getRowCount() != 0) {
|
||||
count = (*queryRet)[0].getUInt32();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user