Merge branch '2836-uninit-fds' into 'main'

tests: Fix use of three uninitialised array elements in spawn-singlethread

Closes #2836

See merge request GNOME/glib!3123
This commit is contained in:
Marco Trevisan 2022-12-13 16:24:13 +00:00
commit 9d51f98ecb

View File

@ -327,8 +327,13 @@ test_spawn_async_with_invalid_fds (void)
gboolean retval;
gsize i;
/* this is very likely going to conflict with the internal fds, if not then skip */
for (i = 3; i < G_N_ELEMENTS (source_fds); i++)
/* Create an identity mapping from [0, …, 999]. This is very likely going to
* conflict with the internal FDs, as it covers a lot of the FD space
* (including stdin, stdout and stderr, though we dont care about them in
* this test).
*
* Skip the test if we somehow avoid a collision. */
for (i = 0; i < G_N_ELEMENTS (source_fds); i++)
source_fds[i] = i;
retval = g_spawn_async_with_pipes_and_fds (NULL, argv, NULL, G_SPAWN_DEFAULT,