]> git.ipfire.org Git - thirdparty/util-linux.git/commit
dmesg: Check input length before calling strtol
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 2 Feb 2026 18:25:56 +0000 (19:25 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 2 Feb 2026 18:25:56 +0000 (19:25 +0100)
commit1540eb2aaab45d9785cd20168d0e3d3f0e280aae
tree7eb31610573e20753523db2c1116ce76df78db6e
parentdcdf40efec22fc6a3eb2d41991f8fadcd78f110a
dmesg: Check input length before calling strtol

The dmesg input can be a memory mapped file, yet strtol is used to
parse numbers (facility, level, and syslog timestamp).

Make sure that a terminating character exists to stop strtol before
reaching end.

While at it, actually check if terminating character is the one we
were looking for.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
sys-utils/dmesg.c