]> Cypherpunks repositories - gostls13.git/commit
encoding/csv: forbid certain Comma and Comment runes
authorJoe Tsai <joetsai@digital-static.net>
Mon, 23 Oct 2017 21:43:51 +0000 (14:43 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Wed, 25 Oct 2017 01:43:46 +0000 (01:43 +0000)
commite7fed7fa353fa8a54759229a0adfe04c02fd7b5a
tree555503805cfcb826722cdf24dbd989ec1479d819
parentaedb79f092be44f13faa7a40ed195b1bf0d27855
encoding/csv: forbid certain Comma and Comment runes

The record delimiter (not configurable by user) is "\r\n" or "\n".
It is insensible for the user to set Comma or Comment delimiters
to be some character that conflicts with the record delimiter.
Furthermore, it is insensible for Comma or Comment to be the same rune.
Allowing this leaks implementation details to the user in regards to
the evaluation order of which rune is checked for first.

Fixes #22404

Change-Id: I31e86abc9b3a8fb4584e090477795587740970ae
Reviewed-on: https://go-review.googlesource.com/72793
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/csv/reader.go
src/encoding/csv/reader_test.go
src/encoding/csv/writer.go