Skip to content

Use the element size when growing the --sync-fd array - #820

Open
Ar-maan05 wants to merge 1 commit into
containers:mainfrom
Ar-maan05:sync-fd-element-size
Open

Ar-maan05 wants to merge 1 commit into
containers:mainfrom
Ar-maan05:sync-fd-element-size

Conversation

@Ar-maan05

Copy link
Copy Markdown

Tiny follow-up to #815: the xrealloc() for opt_sync_fd uses sizeof (&opt_sync_fd[0]), which is the size of a pointer (8) rather than of an int (4). It only over-allocates, so nothing breaks, but it was clearly meant to be sizeof (opt_sync_fd[0]).

Built with meson on Fedora 44 without warnings, and bwrap --sync-fd 3 --sync-fd 4 ... still works.

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 <armaan.sandhu0504@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant