Skip to content

chore: bumping up nom and nom_locate - #612

Merged
joshfried-aws merged 1 commit into
aws-cloudformation:mainfrom
joshfried-aws:audit_fix
Feb 11, 2025
Merged

joshfried-aws merged 1 commit into
aws-cloudformation:mainfrom
joshfried-aws:audit_fix

Conversation

@joshfried-aws

Copy link
Copy Markdown
Contributor

Issue #, if available:
#608

Description of changes:
This PR addresses an issue found by the cargo-audit scanner. It flagged the lexical-core crate for multiple soundness violations. To address this issue we needed to bump up our dependency on both nom parser, and nom locate crates to 7.x and 4.x respectively.

Bumping up nom required us to change the signature for our parser functions that accept an Fn to FnMut this also required us to mark some of these variables as mutable. In addition to this the ParserError type we implement needs to implement ContextError trait as well as FromExternalError where necessary.

Other changes required us to go from using a nom parser named separated_nonempty_list to separated_list1, similarly we needed to go from using a parser fn named separated_list to separated_list0.

There were also a few instances where we needed to be more verbose for the typing in closures, by including the lifetime. Without this the rust compiler can't guarantee the safeness of these lifetimes.

The full changelog mentioning breaking changes can be found here: https://github.com/rust-bakery/nom/blob/6.0.0/CHANGELOG.md


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

@mrinaudo-aws mrinaudo-aws left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joshfried-aws
joshfried-aws merged commit 8903acb into aws-cloudformation:main Feb 11, 2025
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.

3 participants