Fix encoding of a large composite data type
If encoding a field caused a buffer reallocation, the its length would be written to a wrong place.
This commit is contained in:
+1
-1
@@ -576,7 +576,7 @@ func (b *CompositeBinaryBuilder) AppendEncoder(oid uint32, field BinaryEncoder)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if fieldBuf != nil {
|
if fieldBuf != nil {
|
||||||
binary.BigEndian.PutUint32(b.buf[lengthPos:], uint32(len(fieldBuf)-len(b.buf)))
|
binary.BigEndian.PutUint32(fieldBuf[lengthPos:], uint32(len(fieldBuf)-len(b.buf)))
|
||||||
b.buf = fieldBuf
|
b.buf = fieldBuf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user