mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-12 13:38:50 +02:00
glib: Make sure GLIB_OLD_LOG_API is a NUL-terminated string
Every usage in GLib ensures this but theoretically external code might pass something else. As this is only meant to be used internally from GLib, don't support the other case but at least avoid potential out of bound reads.
This commit is contained in:
@ -2625,6 +2625,7 @@ log_is_old_api (const GLogField *fields,
|
|||||||
{
|
{
|
||||||
return (n_fields >= 1 &&
|
return (n_fields >= 1 &&
|
||||||
g_strcmp0 (fields[0].key, "GLIB_OLD_LOG_API") == 0 &&
|
g_strcmp0 (fields[0].key, "GLIB_OLD_LOG_API") == 0 &&
|
||||||
|
fields[0].length < 0 &&
|
||||||
g_strcmp0 (fields[0].value, "1") == 0);
|
g_strcmp0 (fields[0].value, "1") == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user