1
0
Fork 0
mutter-performance-source/src
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
..
backends meta-input-settings-x11: Don't try setting unavailable scroll methods 2016-11-16 13:50:33 +01:00
compositor compositor: End a wayland popup grab when starting a compositor grab 2016-11-02 14:07:14 +01:00
core core: Handle special actions associated to pad buttons in generic code 2016-11-04 21:25:31 +01:00
meta window: Expose Flatpak application ID 2016-10-10 23:35:02 +02:00
tests unit-tests: Fix const compiler warning 2016-03-11 12:26:38 +01:00
ui Always use the default screen 2016-07-23 10:55:02 +08:00
wayland xwayland: Fix lockfile size confusion 2016-11-17 14:31:24 +01:00
x11 x11: Unminimize windows with initial IconicState if first known on MapRequest 2016-11-15 18:39:42 +01:00
.cvsignore Install desktop files in both .../share/applications and 2008-09-12 04:05:17 +00:00
libmutter.pc.in Fix the merged build 2016-04-27 20:37:47 +02:00
Makefile-tests.am tests: Add unit tests framework runner 2016-02-26 17:52:01 +08:00
Makefile.am wayland: Add common object for device classes 2016-09-15 09:54:55 +08:00
meta-enum-types.c.in Install enum types 2015-07-05 22:01:59 -07:00
meta-enum-types.h.in Install enum types 2015-07-05 22:01:59 -07:00
org.freedesktop.login1.xml MetaLauncher: Don't g_error() on failure 2015-11-06 17:03:59 -05:00
org.gnome.Mutter.DisplayConfig.xml backends: Add flags to MetaMonitorMode 2016-05-13 18:44:45 +02:00
org.gnome.Mutter.IdleMonitor.xml Rename the DBus interface files 2014-03-31 23:44:46 -04:00
stamp-mutter-enum-types.h Install enum types 2015-07-05 22:01:59 -07:00