From 33d11e0671142b57b548064157d1a599557a0494 Mon Sep 17 00:00:00 2001 From: Armaan Sandhu Date: Sat, 17 Oct 2026 20:57:19 -0400 Subject: [PATCH] Use the element size when growing the --sync-fd array The xrealloc() for opt_sync_fd uses sizeof (&opt_sync_fd[0]), which is the size of a pointer rather than of an int. This only over-allocates, so it is harmless, but it was clearly meant to be the element size. Signed-off-by: Armaan Sandhu --- bubblewrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bubblewrap.c b/bubblewrap.c index a36adcce..4a12f959 100644 --- a/bubblewrap.c +++ b/bubblewrap.c @@ -2295,7 +2295,7 @@ parse_args_recurse (int *argcp, if (argv[1][0] == 0 || endptr[0] != 0 || the_fd < 0) die ("Invalid fd: %s", argv[1]); - opt_sync_fd = xrealloc (opt_sync_fd, sizeof (&opt_sync_fd[0]) * (opt_sync_fd_count + 1)); + opt_sync_fd = xrealloc (opt_sync_fd, sizeof (opt_sync_fd[0]) * (opt_sync_fd_count + 1)); opt_sync_fd[opt_sync_fd_count++] = the_fd; argv += 1;