Skip to content

Fix Swap endianness data format validation#2515

Open
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-swap-endianness-data-format-validation
Open

Fix Swap endianness data format validation#2515
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-swap-endianness-data-format-validation

Conversation

@marko1olo

Copy link
Copy Markdown

Summary

Fix Swap endianness so an invalid or empty data format argument produces a controlled operation error instead of falling through with the raw input string and later throwing word.push is not a function.

This covers the issue reproduction from #2495, where a deep link can pass an empty first argument: Swap_endianness('',2,true).

Test plan

  • npx grunt configTests
  • node --no-warnings --no-deprecation --openssl-legacy-provider tests/operations/index.mjs -> TOTAL 1962, PASSING 1962
  • npx eslint src/core/operations/SwapEndianness.mjs tests/operations/index.mjs tests/operations/tests/SwapEndianness.mjs
  • git diff --cached --check before commit

Note: the first npm ci attempt hit a network ECONNRESET, and a retry timed out locally. The dependencies installed far enough for the targeted lint, config generation, and full operation test suite above to pass.

Fixes #2495.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Swap Endianness): an uncaught TypeError "u.push is not a function"

3 participants