mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 02:36:19 +01: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:
parent
5bc28aff95
commit
44fb7c5b54
@ -2625,6 +2625,7 @@ log_is_old_api (const GLogField *fields,
|
||||
{
|
||||
return (n_fields >= 1 &&
|
||||
g_strcmp0 (fields[0].key, "GLIB_OLD_LOG_API") == 0 &&
|
||||
fields[0].length < 0 &&
|
||||
g_strcmp0 (fields[0].value, "1") == 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user