badalprasadsingh commented on code in PR #2574:
URL: https://github.com/apache/iceberg-go/pull/2574#discussion_r4565861689
##########
variant_path_test.go:
##########
@@ -143,3 +143,28 @@ func TestParseVariantPathRejects(t *testing.T) {
})
}
}
+
+func TestParseVariantPathRejectsUnescapedControlBytes(t *testing.T) {
+ for c := range 0x20 {
+ for _, path := range []string{
+ "$['a" + string(rune(c)) + "b']",
+ "$['a\\n" + string(rune(c)) + "b']",
+ } {
+ _, err := parseVariantPath(path)
+ require.ErrorIs(t, err, ErrInvalidArgument, "path %q",
path)
+ }
+ }
Review Comment:
we must check the edges that must stay valid: space and DEL
##########
variant_path.go:
##########
@@ -203,6 +203,9 @@ func parseBracketSelector(s, path string) (string, int,
error) {
i += 2
start = i
default:
+ if s[i] < 0x20 {
+ return "", 0, fmt.Errorf("%w: invalid variant
path %q (unescaped control character in quoted member)", ErrInvalidArgument,
path)
+ }
Review Comment:
P2: extract paths with a raw control in a quoted member worked in v0.7.0 and
now fail in Bind, so scans return an error, go literals like "$['a\tb']" hit
this
better: add a bullet under "Unreleased compatibility notes" like the
NaN-literal one
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]