diff options
author | Lee Jones <lee@kernel.org> | 2023-12-13 19:42:35 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-15 15:55:30 +0300 |
commit | 01dc7f7c29be8b4fa853eb300f54065d981b31a9 (patch) | |
tree | 0a10efbc34ca1402c6f16360cd26a9a0eb457a0c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | d32dcb0659bcb3b68878a985280024ec92d0db5b (diff) | |
download | linux-01dc7f7c29be8b4fa853eb300f54065d981b31a9.tar.xz |
usb: cdns2: Replace snprintf() with the safer scnprintf() variant
There is a general misunderstanding amongst engineers that {v}snprintf()
returns the length of the data *actually* encoded into the destination
array. However, as per the C99 standard {v}snprintf() really returns
the length of the data that *would have been* written if there were
enough space for it. This misunderstanding has led to buffer-overruns
in the past. It's generally considered safer to use the {v}scnprintf()
variants in their place (or even sprintf() in simple cases). So let's
do that.
Link: https://lwn.net/Articles/69419/
Link: https://github.com/KSPP/linux/issues/105
Cc: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20231213164246.1021885-7-lee@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions