Skip to content

Commit 5074f75

Browse files
mergify[bot]woody-appleclaudepre-commit-ci[bot]andy31415
authored
Fix BDX block data pointer to track delegate buffer adjustments (#71940) (#72346)
* Fix BDX block data pointer to track delegate buffer adjustments In OnAckReceived(), blockData.Data used blockBuf->Start() (the original buffer start) while blockData.Length used buffer.size() (potentially reduced by the delegate). If a CollectLog delegate implementation adjusts the span's data pointer (e.g., via SubSpan), the data pointer and length would be misaligned, potentially sending uninitialized memory. Use buffer.data() to correctly track any adjustment the delegate made. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Trigger CI re-run for flaky REPL test * Retrigger CI --------- (cherry picked from commit 32f1ce0) Co-authored-by: Justin Wood <woody@apple.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Andrei Litvin <andy314@gmail.com>
1 parent 1334c60 commit 5074f75

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/app/clusters/diagnostic-logs-server/BDXDiagnosticLogsProvider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void BDXDiagnosticLogsProvider::OnAckReceived()
197197

198198
// Prepare the BDX block to send to the requestor
199199
TransferSession::BlockData blockData;
200-
blockData.Data = blockBuf->Start();
201-
blockData.Length = static_cast<size_t>(buffer.size());
200+
blockData.Data = buffer.data();
201+
blockData.Length = buffer.size();
202202
blockData.IsEof = isEndOfLog;
203203

204204
err = mTransfer.PrepareBlock(blockData);

0 commit comments

Comments
 (0)