OSDN Git Service

mailbox: bcm-pdc: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:45:13 +0000 (08:45 +0100)
committerJassi Brar <jaswinder.singh@linaro.org>
Fri, 20 Mar 2020 04:00:32 +0000 (23:00 -0500)
commit38a5456a6dc3ccf3864d5341a2e7753350273922
treeaaaaef521f64a7292792070dd58dcbfb89af678a
parent223a83bdcc56effed63661ac9ae209fea0223078
mailbox: bcm-pdc: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/bcm-pdc-mailbox.c