JS: fix yaml StringIndexOutOfBoundsException#1485
Merged
semmle-qlci merged 3 commits intomasterfrom Jul 2, 2019
unknown repository
Merged
JS: fix yaml StringIndexOutOfBoundsException#1485semmle-qlci merged 3 commits intomasterfrom unknown repository
semmle-qlci merged 3 commits intomasterfrom
unknown repository
Conversation
Contributor
There was a problem hiding this comment.
I'm confused by the name isShortString when it's defined to be true is when src is longer than a certain limit. Was there a negation that was flipped during a refactoring here?
Author
There was a problem hiding this comment.
Amended to hasAccessToDesiredString.
It's targeted at master, though. |
|
If we're putting this into 1.21, then maybe we should include #1481 as well. What do you think? |
Author
|
I agree, as they are both simple crash fixes. Do you want a cherry pick of the #1481 commit into this PR, or a separate PR? |
|
Maybe just add it to this PR? |
`ScalarEvent.getStyle()` is documented as returning `null` for plain scalars, so we need to handle that specially (cf https://github.com/Semmle/ql/blob/master/javascript/ql/src/semmle/javascript/YAML.qll#L100 for the corresponding code in the library, which expects plain style to be encoded as zero).
|
This PR may not need to go into the release after all, so please don't merge yet. |
xiemaisi
approved these changes
Jul 1, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes ODASA-7993.
We previously got a
StringIndexOutOfBoundsExceptioninmkToStringon some YAML files with long lines that had been truncated before we got access to them.We no longer get an exception on such truncated lines, and treat them like multiline strings.
I think this needs to go into 1.21.
@tibbes