glib: Don't require GLIB_DOMAIN to be a NUL-terminated string

The length might be passed explicitly in the field instead, and the
string might not have a NUL-terminator as happens for example when
passed from the Rust bindings.

This might lead to out of bounds reads.

Thanks to Sebastian Wiesner for noticing this.
This commit is contained in:
Sebastian Dröge
2024-10-14 18:56:55 +03:00
committed by Philip Withnall
parent 7e4fcb4fa8
commit 5bc28aff95
2 changed files with 65 additions and 10 deletions

View File

@@ -707,6 +707,7 @@ functions = [
'lstat',
'mbrtowc',
'memalign',
'memmem',
'mmap',
'newlocale',
'pipe2',