Thread (42 messages) flat view 42 messages, 7 authors, 4d ago

Re: [PATCH v2 5/7] trace2: remove use of xstrfmt()

From: Derrick Stolee <hidden>
Date: 2026-08-31 12:51:06

On 8/25/2026 6:36 PM, Junio C Hamano wrote:
Elijah Newren [off-list ref] writes:
quoted
On Tue, Aug 25, 2026 at 11:59 AM Derrick Stolee via GitGitGadget
[off-list ref] wrote:
quoted
[...]
quoted
+       const char *redact = ":<REDACTED>";
+       char *redacted;
[...]
quoted
+       memcpy(redacted, arg, prefix_len);
+       memcpy(redacted + prefix_len, redact, redact_len - 1);
Only copy redact_len - 1 bytes?  So only ":<REDACTED" without the
trailing ">" ?  Why?
Yeah, if it were (redact_len + 1) it would have worked better, perhaps?
I should have been more careful and realized that we don't have any
tests that cover this logic.

We have tests for ":<redacted>" in pkt-line output, but not for the
trace2 version.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help