Build error in 4.3.0: sync_pipe_run_command_actual error: argument 2 is null but the corresponding size argument 3 value is 512004 [-Werror=nonnull]
Summary
I get a build error for 4.3.0
Steps to reproduce
Here's how we're trying to build Wireshark:
https://github.com/flathub/org.wireshark.Wireshark/pull/192
There are no super special compiler flags: https://github.com/flathub/org.wireshark.Wireshark/blob/3b1df582675323882a478ba3e79fa6a2b7825754/org.wireshark.Wireshark.yml#L286
What is the current bug behavior?
build fails
What is the expected correct behavior?
build succeeds
Relevant logs and/or screenshots
[126/2715] Building C object capture/CMakeFiles/capchild.dir/capture_sync.c.o
FAILED: capture/CMakeFiles/capchild.dir/capture_sync.c.o
/usr/bin/cc -DCARES_NO_DEPRECATED -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -I/run/build/wireshark -I/run/build/wireshark/include -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -fvisibility=hidden -Wall -Wextra -Wpointer-arith -Wformat-security -fno-strict-overflow -fexcess-precision=fast -Wvla -Wattributes -Wpragmas -Wredundant-decls -Wunreachable-code -Wlogical-op -Wno-error=stringop-overflow= -Wno-error=deprecated-declarations -Wframe-larger-than=32768 -Wno-format-truncation -fdiagnostics-color=always -Wshadow -Wold-style-definition -Wstrict-prototypes -Wno-pointer-sign -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -fmacro-prefix-map="/run/build/wireshark/"= -fmacro-prefix-map="/run/build/wireshark/"= -O3 -DNDEBUG -std=gnu11 -fPIC -Werror -MD -MT capture/CMakeFiles/capchild.dir/capture_sync.c.o -MF capture/CMakeFiles/capchild.dir/capture_sync.c.o.d -o capture/CMakeFiles/capchild.dir/capture_sync.c.o -c /run/build/wireshark/capture/capture_sync.c
In file included from /usr/include/features.h:503,
from /usr/include/inttypes.h:25,
from /run/build/wireshark/include/wireshark.h:31,
from /run/build/wireshark/capture/capture_sync.c:14:
In function ‘read’,
inlined from ‘sync_pipe_run_command_actual’ at /run/build/wireshark/capture/capture_sync.c:1191:29:
/usr/include/x86_64-linux-gnu/bits/unistd.h:28:10: error: argument 2 is null but the corresponding size argument 3 value is 512004 [-Werror=nonnull]
28 | return __glibc_fortify (read, __nbytes, sizeof (char),
| ^~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/unistd-decl.h: In function ‘sync_pipe_run_command_actual’:
/usr/include/x86_64-linux-gnu/bits/unistd-decl.h:29:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
29 | extern ssize_t __REDIRECT_FORTIFY (__read_alias, (int __fd, void *__buf,
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[127/2715] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-amt.c.o