mirror of
https://github.com/FiloSottile/age.git
synced 2026-01-03 10:55:14 +00:00
armor: reject empty lines in armored data
Caught by the new CCTV test vectors!
This commit is contained in:
committed by
Filippo Valsorda
parent
d7409cdc74
commit
96b6476140
@@ -140,6 +140,9 @@ func (r *armoredReader) Read(p []byte) (int, error) {
|
||||
if string(line) == Footer {
|
||||
return 0, r.setErr(drainTrailing())
|
||||
}
|
||||
if len(line) == 0 {
|
||||
return 0, r.setErr(errors.New("empty line in armored data"))
|
||||
}
|
||||
if len(line) > format.ColumnsPerLine {
|
||||
return 0, r.setErr(errors.New("column limit exceeded"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user