Go to file
Daniel Stone f99a086444 xwayland: Fix lockfile size confusion
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
2016-11-17 14:31:24 +01:00
clutter clutter: Fix build 2016-11-07 14:24:36 +01:00
cogl cogl/egl: Fix non-Wayland build 2016-09-02 17:04:11 +08:00
data build: Say good-bye to intltool 2016-08-19 11:04:48 +02:00
doc configure: get rid of docs 2016-04-22 16:39:45 +02:00
po Update zh_CN translation 2016-10-30 02:20:44 +08:00
src xwayland: Fix lockfile size confusion 2016-11-17 14:31:24 +01:00
tools Clean up the source tree 2014-03-18 20:37:35 -04:00
.gitignore wayland: Add support for the xdg-foreign protocol 2016-08-22 21:03:41 +08:00
autogen.sh prune out non library bits 2016-04-22 16:39:46 +02:00
configure.ac Bump version to 3.23.1 2016-10-30 22:24:13 +01:00
COPYING prune out non library bits 2016-04-22 16:39:46 +02:00
Makefile.am Fix the merged build 2016-04-27 20:37:47 +02:00
mutter.doap doap: add <programming-language> 2014-07-31 17:50:28 +02:00
NEWS Bump version to 3.23.1 2016-10-30 22:24:13 +01:00