Add blocksize validation in XORChecksum run method

Added validation check for blocksize parameter in run method.
This commit is contained in:
Subhadeep 2026-06-15 16:25:10 +05:30 committed by GitHub
parent 55d0bbc90f
commit fcceb72e9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,7 @@ class XORChecksum extends Operation {
run(input, args) { run(input, args) {
const blocksize = args[0]; const blocksize = args[0];
// 2. Added validation check
if (!Number.isInteger(blocksize) || blocksize <= 0) { if (!Number.isInteger(blocksize) || blocksize <= 0) {
throw new OperationError("Blocksize must be a positive integer."); throw new OperationError("Blocksize must be a positive integer.");
} }