Fix out-of-bounds read on invalid query message
When the parsing of a query failed, the message would treat the parameter as a string as the printf format was `%*s` instead of `%.*s`. The manpage of printf states the following about the precision specifier: ... or the maximum number of characters to be printed from a string for `s` and `S` conversions. This means that the field length specifier is somewhat meaningless for strings.
This commit is contained in:
parent
71c6f4db4e
commit
bce5627ee3
@ -3603,7 +3603,7 @@ static void log_invalid_data(GWBUF* query, const char* message)
|
||||
length = (int)GWBUF_LENGTH(query) - MYSQL_HEADER_LEN - 1;
|
||||
}
|
||||
|
||||
MXS_INFO("Parsing the query failed, %s: %*s", message, length, sql);
|
||||
MXS_INFO("Parsing the query failed, %s: %.*s", message, length, sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user