]> sourceware.org Git - systemtap.git/commit
PR28778: gcc warning tweak for sprintf precision parameter
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 13 Jan 2022 23:33:15 +0000 (18:33 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 13 Jan 2022 23:33:15 +0000 (18:33 -0500)
commitb0422e9e5a539164af75cddcaeb01bceca56bf12
tree509d1a3c803fe5b3d5e11ae47dc57c24644b03c2
parent83d1eea4a5a188976ea6704ccd34d183b8087073
PR28778: gcc warning tweak for sprintf precision parameter

A precision=-1 sentinel value got interpreted as UINT_MAX in a
context, leading to diagnostics like:

/usr/share/systemtap/runtime/vsprintf.c:341:23: error: 'strnlen' specified bound 4294967295 may exceed maximum object size 2147483647 [-Werror=stringop-overread]

Adding a clamp_t() around the parameter field to keep it limited to
STP_BUFFER_SIZE (8K by default), which is apprx. the limit for a
single printf.
runtime/vsprintf.c
This page took 0.027784 seconds and 5 git commands to generate.