Validate random and QR input bounds#2480
Conversation
|
Please could you add an AI Disclosure statement in the PR description. The template added when manually creating a PR reads: AI disclosure |
|
Closing as 2 out of 3 issues have been fixed by the new automated validation framework (#2561) and the remaining one is better fixed by using that framework - and #2586 includes this fix. However thanks for your contribution. The creation of the validation framework was inspired by the realisation that multiple PRs of this nature would otherwise need to be created in order to address these types of issue. |
Summary
Adds explicit input validation for three operation edge cases so invalid numeric arguments return clear CyberChef operation messages instead of unhandled
RangeErrors or silent empty output.Fixes #2447.
Fixes #2448.
Fixes #2449.
Changes
Generate QR Codemodule size and margin before callingqr-image.Pseudo-Random Number Generatorbyte count before allocating/generating bytes.Pseudo-Random Integer Generatorcount before generating output.Verification
npx grunt configTestsnpm run lintnpm testnpm startand Playwright MCP against the issue deep linksnpm run buildNote:
npm run buildcompleted successfully. During build, Webpack Bundle Analyzer printed existing ENOENT parsing warnings for worker bundle names while generating its report, then webpack compiled successfully and Grunt finished withDone.