Skip to content

xwayland/sockets: fix uninitialized display socket path

sewn requested to merge sewn/wlroots:master into master

Fixes the following build error on Alpine:

In file included from ../xwayland/sockets.c:8:
In function 'snprintf',
    inlined from 'unlink_display_sockets' at ../xwayland/sockets.c:154:2:
/usr/include/fortify/stdio.h:284:16: error: 'sun_path' may be used uninitialized [-Werror=maybe-uninitialized]
  284 |         return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/fortify/stdio.h:26:
/usr/include/fortify/stdio.h: In function 'unlink_display_sockets':
/usr/include/fortify/stdio.h:274:1: note: in a call to '__orig_snprintf' declared with attribute 'access (read_write, 1, 2)' here
  274 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
      | ^~~~~~~~~~~
../xwayland/sockets.c:152:14: note: 'sun_path' declared here
  152 |         char sun_path[64];
      |              ^~~~~~~~
cc1: all warnings being treated as errors
ninja: subcommand failed

Merge request reports

Loading