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

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2836
This commit is contained in:
Philip Withnall 2022-12-13 14:18:36 +00:00
parent 7bb0261407
commit d5011f91a8

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,