Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Conversation

@zecke
Copy link

@zecke zecke commented May 3, 2023

When using:

 >-
   someline
     more

The encoder would emit:

 >-
   someline

     more

The issue was introduced in the original translation from C to Go. In the C code the MOVE macro would advance the start pointer of the string. In the Go case "k = 0" points to the start of the string where in the C case it would be the read pointer. Fix it.

Also address bound checks to not go beyond the string (I assume in the C code there is an explicit NUL or at least some NUL).

Fixes: #804

When using:

 >-
   someline
     more

The encoder would emit:

 >-
   someline

     more

The issue was introduced in the original translation from C to
Go. In the C code the MOVE macro would advance the start pointer
of the string. In the Go case "k = 0" points to the start of the
string where in the C case it would be the read pointer. Fix it.

Also address bound checks to not go beyond the string (I assume in
the C code there is an explicit NUL or at least some NUL).

Fixes: go-yaml#804
@zecke
Copy link
Author

zecke commented May 14, 2023

@niemeyer Any chance you can have a look?

@dolmen
Copy link

dolmen commented Mar 12, 2024

@zecke In #1028 I'm proposing to add a fuzzer.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3: FoldedStyle yaml.Node results in unexpected newlines

3 participants