diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-03-23 07:57:03 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-26 10:45:52 +0100 |
| commit | 16fac242177c5eb374bb2caacc28793732857369 (patch) | |
| tree | 1669e462439335cfca125303d3f7dc4b8a01850f /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | f8453bbde06c5d515b8487eb443d26307b2eec23 (diff) | |
usb: gadget: u_audio: Fix the size of a buffer in a strscpy() call
The size given to strscpy() is not consistent with the destination buffer
that is used. The size is related to 'driver' and the buffer is
'mixername'.
sizeof(card->mixername) is 80 and sizeof(card->driver) is 16, so in
theory this could lead to unneeded string truncation.
In practice, this is not the case because g_audio_setup() has only 2
callers. 'card_name' is either "UAC1_Gadget" or "UAC2_Gadget".
Anyway, using the correct size is cleaner and more future proof.
In order to be less verbose, use the new 2-argument version of strscpy()
which computes auto-magically the size of the destination.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/bf8a9353319566624f653531b80e5caf3d346ba1.1711176700.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
