mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
Read-only mirror of https://gitlab.gnome.org/GNOME/mutter
f99a086444
Similarly to Weston (where this code originated), there were two errors in the X11 lockfile handling. Firstly, after reading 11 characters from the lock file (which could have been placed by any process), there was no guarantee of NUL-termination, meaning strtol could've theoretically run off the end of the string. Secondly, whilst writing the new lock, the trailing NUL byte was not correctly accounted for. The size passed as an input to snprintf takes the maximum size of the string including the trailing NUL, whilst the return (and the input to write) gives the actual size of the string without the trailing NUL. The code did attempt to check the return value, however snprintf returns the size of the _potential_ string written, before snprintf culls it, so this was off by one, and the LF was not being written. Signed-off-by: Daniel Stone <daniels@collabora.com> https://bugzilla.gnome.org/show_bug.cgi?id=774613 |
||
---|---|---|
clutter | ||
cogl | ||
data | ||
doc | ||
po | ||
src | ||
tools | ||
.gitignore | ||
autogen.sh | ||
configure.ac | ||
COPYING | ||
Makefile.am | ||
mutter.doap | ||
NEWS |