mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-16 17:08:31 +01:00
BUGFIX: Jump operations skipping an operation once maxJumps reached.
This commit is contained in:
parent
3ad4291258
commit
70603be5ab
2 changed files with 45 additions and 2 deletions
|
@ -128,7 +128,6 @@ var FlowControl = {
|
||||||
maxJumps = ings[1];
|
maxJumps = ings[1];
|
||||||
|
|
||||||
if (state.numJumps >= maxJumps) {
|
if (state.numJumps >= maxJumps) {
|
||||||
state.progress++;
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +155,6 @@ var FlowControl = {
|
||||||
maxJumps = ings[2];
|
maxJumps = ings[2];
|
||||||
|
|
||||||
if (state.numJumps >= maxJumps) {
|
if (state.numJumps >= maxJumps) {
|
||||||
state.progress++;
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,4 +64,49 @@ TestRegister.addTests([
|
||||||
{"op":"To Base64", "args":["A-Za-z0-9+/="]}
|
{"op":"To Base64", "args":["A-Za-z0-9+/="]}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Conditional Jump: Skips 0",
|
||||||
|
input: [
|
||||||
|
"match",
|
||||||
|
"should be changed 1",
|
||||||
|
"should be changed 2",
|
||||||
|
].join("\n"),
|
||||||
|
expectedOutput: [
|
||||||
|
"match",
|
||||||
|
"should be changed 1 was changed",
|
||||||
|
"should be changed 2 was changed"
|
||||||
|
].join("\n"),
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "Conditional Jump",
|
||||||
|
args: ["match", 0, 0],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
op: "Find / Replace",
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
"option": "Regex",
|
||||||
|
"string": "should be changed 1"
|
||||||
|
},
|
||||||
|
"should be changed 1 was changed",
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
op: "Find / Replace",
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
"option": "Regex",
|
||||||
|
"string": "should be changed 2"
|
||||||
|
},
|
||||||
|
"should be changed 2 was changed",
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue