mirror of
https://github.com/swaywm/sway
synced 2024-11-23 17:32:40 +01:00
79369681ab
When swaynag is run with the -l/--detailed-message option, a crash may occur if the detailed message read from stdin is large enough. E.g.: swaynag -m hello -l < ~/.config/sway/config The root cause is that the read_from_stdin() function under-allocates memory for the destination buffer which causes that buffer to be overflowed when copying line data to it with snprintf(). The repair is to allocate one more byte for the terminating null byte. N.B. although getline() returns the number of bytes read excluding a terminating null byte, the line buffer is terminated with a null byte. Thus we have a guarantee that the line buffer will be null terminated (which is important when copying with snprintf()). |
||
---|---|---|
.. | ||
config.c | ||
main.c | ||
meson.build | ||
render.c | ||
swaynag.1.scd | ||
swaynag.5.scd | ||
swaynag.c | ||
types.c |