Skip to content

Conversation

opsysdebug
Copy link
Contributor

@opsysdebug opsysdebug commented May 13, 2025

arr.push(buf.slice(start, start + chunk_size[i]));

fix the issue need to ensure that the buf parameter in the stripChunkSignature function is of the expected type (Buffer). If buf is not a Buffer, the function should either throw an error or return the input unchanged, depending on the desired behavior. This can be achieved by adding a runtime type check at the beginning of the function.

  1. Add a type check to verify that buf is a Buffer using Buffer.isBuffer(buf).
  2. If the check fails, return the input unchanged or handle the error appropriately.
  3. This change ensures that the function behaves predictably even if buf is tampered with.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@opsysdebug opsysdebug requested a review from a team as a code owner May 13, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant