fix trailing space stripping for different encodings#10
Conversation
|
augment review |
🤖 Augment PR SummarySummary: This PR makes trailing-space stripping safer and encoding-aware when exporting dataset records to a temp file. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
|
augment review |
cfa6c72 to
679d937
Compare
|
augment review |
|
augment review |
1 similar comment
|
augment review |
| while (i < dfile->bufflen) { | ||
| if (write(temp_fd, &data[i], dfile->reclen) != dfile->reclen) { | ||
| int actual_len = dfile->reclen; | ||
| if (i + actual_len > dfile->bufflen) { |
There was a problem hiding this comment.
In the fixed-length (no length prefix) path, clamping actual_len to the remaining buffer will silently write a partial final record if bufflen isn’t a multiple of reclen, which can mask buffer corruption and produce output that downstream code can’t parse reliably. Should this case be treated as an error (similar to the length-prefixed branch) instead of emitting a truncated record?
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
#10 (comment)