fix: guard against null pointer dereference in sormcq parameter conversion and add missing merge logic for logs_plain

This commit is contained in:
2025-03-17 03:58:10 +00:00
parent 764fba3a6e
commit 0813f3e46e
5 changed files with 38 additions and 8 deletions
+10 -2
View File
@@ -8663,14 +8663,22 @@ unsigned int sormcq(char *sql, char *out) {
// converts %s %i parameters to ?
unsigned int count = 0;
char prev = 0;
while (*sql) {
if (*sql != '%' && *sql != '?')
if ((*sql != '%') && (*sql != '?'))
*out = *sql;
else {
count++;
sql++;
if(*sql == '%'){
*out = '%';
//sql++;
}else{
count++;
*out = '?';
}
}
prev = *sql;
out++;
sql++;
}