Commit: 2908491c7efee5e14e880aa7a49ee6e5f098a24d
Parent: f9f98c0b2aa44fe47482e083d428fa3b54ecdeb2
Author: Celeste Liu <coelacanthushex@gmail.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-09-17 17:13:49
Tree: c99f173f1ae78ac8993b4d073d2eb1db8ccf25a5

monitor: fix buffer overflow when terminal width > 255 In current code, we create line buffer with size 256, which can contains 255 ASCII characters. But in modern system, terminal can have larger width. It may cause buffer overflow in snprintf() text. limits.h provides constant LINE_MAX. {LINE_MAX} Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>. Minimum Acceptable Value: {_POSIX2_LINE_MAX}

Diffstat

M monitor/packet.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)

View Full Diff | Patch