exif: Allow more spacing characters in strings

The root cause of issue #8079 was a non-breaking space (U+0160).
`unicode.IsPrint` only allows the ASCII space (U+0020).  Be more lenient
by using `unicode.IsGraphic` instead.

Fixes #8079
This commit is contained in:
Cameron Moore
2021-03-13 09:21:30 -06:00
committed by Bjørn Erik Pedersen
parent 4d24e2a326
commit 0a2ab3f8fe
3 changed files with 15 additions and 1 deletions

View File

@@ -227,7 +227,7 @@ func (e *exifWalker) Walk(f _exif.FieldName, tag *tiff.Tag) error {
func nullString(in []byte) string {
var rv bytes.Buffer
for _, b := range in {
if unicode.IsPrint(rune(b)) {
if unicode.IsGraphic(rune(b)) {
rv.WriteByte(b)
}
}