mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
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:
commit
9d51f98ecb
@ -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 don’t 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,
|
||||
|
Loading…
Reference in New Issue
Block a user