projects
/
dnssec-prover
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70c3afd
)
Correct length calculation when writing TXT records
author
Matt Corallo
<git@bluematt.me>
Tue, 6 Feb 2024 17:50:47 +0000
(17:50 +0000)
committer
Matt Corallo
<git@bluematt.me>
Tue, 6 Feb 2024 17:50:47 +0000
(17:50 +0000)
src/rr.rs
patch
|
blob
|
history
diff --git
a/src/rr.rs
b/src/rr.rs
index 3d1a6a8548ee01d9038001a02f2a1e3d34a46aa9..14826e3d1e00c53c76b691e4c06ef9ed762dd791 100644
(file)
--- a/
src/rr.rs
+++ b/
src/rr.rs
@@
-189,7
+189,7
@@
impl StaticRecord for Txt {
Ok(Txt { name, data: parsed_data })
}
fn write_u16_len_prefixed_data(&self, out: &mut Vec<u8>) {
- let len = (self.data.len() +
self.data.len() / 255 + 1
) as u16;
+ let len = (self.data.len() +
(self.data.len() + 254) / 255
) as u16;
out.extend_from_slice(&len.to_be_bytes());
let mut data_write = &self.data[..];