fix: reset Signature when unmarshaling legacy V1 xl.meta headers

The V1 header wire format has no Signature field, so decoding into a
reused header leaked the previous object's signature. Reset it along
with EcN/EcM so a decode fully replaces the header contents.

Signed-off-by: Julien Laurenceau <julien.laurenceau@pepitedata.com>
This commit is contained in:
Julien Laurenceau
2026-10-12 17:12:49 +02:00
parent a54d0c4354
commit ba6e8c8d69
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -40,6 +40,9 @@ func (x *xlMetaV2VersionHeader) unmarshalV(v uint8, bts []byte) (o []byte, err e
// unmarshalV1 decodes version 1, never released.
func (x *xlMetaV2VersionHeader) unmarshalV1(bts []byte) (o []byte, err error) {
// Fields absent from the V1 wire format must be reset since the
// header may be reused across decodes.
x.Signature = [4]byte{}
x.EcN, x.EcM = 0, 0
var zb0001 uint32
zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)