mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
commands/test: Fix error in recursion depth calculation
The commitc68b7d236(commands/test: Stack overflow due to unlimited recursion depth) added recursion depth tests to the test command. But in the error case it decrements the pointer to the depth value instead of the value itself. Fix it. Fixes:c68b7d236(commands/test: Stack overflow due to unlimited recursion depth) Signed-off-by: Thomas Frauendorfer | Miray Software <tf@miray.de> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
95e614a11b
commit
cc9d621dd0
1 file changed
+1
-1
@@ -403,7 +403,7 @@ test_parse (char **args, int *argn, int argc, int *depth)
|
||||
if (++(*depth) > MAX_TEST_RECURSION_DEPTH)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, N_("max recursion depth exceeded"));
|
||||
depth--;
|
||||
(*depth)--;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user