summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-07-06 10:59:48 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-07-19 20:29:36 +0200
commit0159a9305d401fd21a1cda5e7baaf62122c46a5b (patch)
treee8d3765772c78bfcd5d29614c91ff2c6ce8872dd /tools/perf/scripts/python/export-to-sqlite.py
parente22c88799f2629088504e1357384f2ec3798da46 (diff)
can: slcan: use scnprintf() as a hardening measure
The snprintf() function returns the number of bytes which *would* have been copied if there were no space. So, since this code does not check the return value, there if the buffer was not large enough then there would be a buffer overflow two lines later when it does: actual = sl->tty->ops->write(sl->tty, sl->xbuff, n); Use scnprintf() instead because that returns the number of bytes which were actually copied. Fixes: 52f9ac85b876 ("can: slcan: allow to send commands to the adapter") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/all/YsVA9KoY/ZSvNGYk@kili Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions