fix: 6 bugs (timeline path value, seer SSE cursor, erasure checksum, subtle compare, build status code, dead WorkerName branch)
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
This commit is contained in:
@@ -176,12 +176,12 @@ func (s *Service) Reconstruct(ctx context.Context, bundleID string, indices []in
|
||||
for i := 0; i < bundle.DataShards; i++ {
|
||||
out = append(out, shards[i]...)
|
||||
}
|
||||
// Trim padding — find actual length via checksum match
|
||||
sum := sha256.Sum256(out)
|
||||
trimmed := trimNullPadding(out)
|
||||
sum := sha256.Sum256(trimmed)
|
||||
if hex.EncodeToString(sum[:]) != bundle.Checksum {
|
||||
// Return best-effort; caller validates
|
||||
return nil, fmt.Errorf("reconstructed data checksum mismatch: bundle may be corrupt")
|
||||
}
|
||||
return trimNullPadding(out), nil
|
||||
return trimmed, nil
|
||||
}
|
||||
|
||||
func trimNullPadding(b []byte) []byte {
|
||||
|
||||
Reference in New Issue
Block a user