* [PATCH] Avoid format truncation
@ 2021-11-14 21:14 Boian Bonev
2021-11-15 16:45 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Boian Bonev @ 2021-11-14 21:14 UTC (permalink / raw)
To: linux-xfs; +Cc: bage, Boian Bonev
io.c:644:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 8
Signed-off-by: Boian Bonev <bbonev@ipacct.com>
---
db/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/io.c b/db/io.c
index c79cf105..154c3bd9 100644
--- a/db/io.c
+++ b/db/io.c
@@ -638,7 +638,7 @@ stack_f(
char **argv)
{
int i;
- char tagbuf[8];
+ char tagbuf[14];
for (i = iocur_sp; i > 0; i--) {
snprintf(tagbuf, sizeof(tagbuf), "%d: ", i);
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Avoid format truncation
2021-11-14 21:14 [PATCH] Avoid format truncation Boian Bonev
@ 2021-11-15 16:45 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2021-11-15 16:45 UTC (permalink / raw)
To: Boian Bonev; +Cc: linux-xfs, bage
On Sun, Nov 14, 2021 at 11:14:58PM +0200, Boian Bonev wrote:
> io.c:644:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 8
>
> Signed-off-by: Boian Bonev <bbonev@ipacct.com>
I really hope nobody ever gets to a cursor depth of 4 billion, but the
logic is correct, so...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> db/io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/db/io.c b/db/io.c
> index c79cf105..154c3bd9 100644
> --- a/db/io.c
> +++ b/db/io.c
> @@ -638,7 +638,7 @@ stack_f(
> char **argv)
> {
> int i;
> - char tagbuf[8];
> + char tagbuf[14];
>
> for (i = iocur_sp; i > 0; i--) {
> snprintf(tagbuf, sizeof(tagbuf), "%d: ", i);
> --
> 2.33.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-15 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-14 21:14 [PATCH] Avoid format truncation Boian Bonev
2021-11-15 16:45 ` Darrick J. Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.