GCC 12.2 rightfully complains about an out-of-founds array access. This can possibly happen for unsupported variable names.
This is a rudimentary fix (don't write outside of array), but current code will require more cudling (eg: native runs the loop for every parsed token even if the variable name isn't supported) while builtin stops parsing.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
From: Eric Pouech eric.pouech@gmail.com
GCC 12.2 rightfully complains about an out-of-founds array access. This can possibly happen for unsupported variable names.
This is a rudimentary fix (don't write outside of array), but current code will require more cudling (eg: native runs the loop for every parsed token even if the variable name isn't supported) while builtin stops parsing.
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- programs/cmd/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 82008c3ec7a..4856b619812 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2025,7 +2025,7 @@ static void WCMD_parse_line(CMD_LIST *cmdStart, }
/* Execute the body of the foor loop with these values */ - if (forloopcontext.variable[varidx] && forloopcontext.variable[varidx][0] != forf_eol) { + if (varidx >= 0 && forloopcontext.variable[varidx] && forloopcontext.variable[varidx][0] != forf_eol) { CMD_LIST *thisCmdStart = cmdStart; *doExecuted = TRUE; WCMD_part_execute(&thisCmdStart, firstCmd, FALSE, TRUE);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126117
Your paranoid android.
=== debian11 (build log) ===
0234:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0234:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0234:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.