diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-09-04 22:54:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-06 15:56:53 +0300 |
commit | dfbcef80dda96f6433eb6db6d146e68c46cf314c (patch) | |
tree | 2b414a918ed2e06583031be19a09948916aa86a0 /.gitattributes | |
parent | 797d75bd575cbc5263b870adad900ce0ae69cf06 (diff) | |
download | linux-dfbcef80dda96f6433eb6db6d146e68c46cf314c.tar.xz |
ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()
[ Upstream commit e97eb65dd464e7f118a16a26337322d07eb653e2 ]
snprintf() returns the "number of characters which *would* be generated for
the given input", not the size *really* generated.
In order to avoid too large values for 'o' (and potential negative values
for "sizeof(linebuf) o") use scnprintf() instead of snprintf().
Note that given the "w < 4" in the for loop, the buffer can NOT
overflow, but using the *right* function is always better.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions