Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Florian Schmidt <flosch@nutanix.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
	Jonathan Davies <jonathan.davies@nutanix.com>,
	Phillip Wood <phillip.wood@dunelm.org.uk>,
	Denton Liu <liu.denton@gmail.com>
Subject: Re: [PATCH] wt-status: Don't find scissors line beyond buf len
Date: Fri, 8 Mar 2024 09:13:12 +0000	[thread overview]
Message-ID: <d280a87b-e6ab-4f0d-b112-bbedc223c9fd@nutanix.com> (raw)
In-Reply-To: <xmqqsf11ltrt.fsf@gitster.g>

On 07/03/2024 19:35, Junio C Hamano wrote:
> Florian Schmidt <flosch@nutanix.com> writes:
> 
>> Side remark: Since strstr() doesn't consider len, and will always search
>> up to a null byte, I now wonder whether it would be safer to create a
>> new strbuf that only contains the len bytes we want to operate on.
> 
> That is a valid concern in general, but does not seem to apply to
> the current codebase.  Thanks for being careful.

Thanks, that confirms my cursory look at the consumers of the function. 
If you think that it's unlikely that in the future, a new user of this 
function would provide a non-terminated string, then there is no need 
for action. I guess the aim is to use strbufs wherever suitable in the 
first place, anyway, and those won't have this issue?

Cheers,
flosch

      reply	other threads:[~2024-03-08  9:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 18:37 [PATCH] wt-status: Don't find scissors line beyond buf len Florian Schmidt
2024-03-07 19:20 ` Junio C Hamano
2024-03-07 20:47   ` Junio C Hamano
2024-03-07 21:09     ` Eric Sunshine
2024-03-07 21:15     ` Kristoffer Haugsbakk
2024-03-07 21:24       ` Junio C Hamano
2024-03-07 21:26         ` Eric Sunshine
2024-03-07 21:30           ` Kristoffer Haugsbakk
2024-03-08  9:08   ` Florian Schmidt
2024-03-08 15:26     ` Junio C Hamano
2024-03-08 17:43       ` Florian Schmidt
2024-04-06  1:37   ` Linus Arver
2024-03-07 19:35 ` Junio C Hamano
2024-03-08  9:13   ` Florian Schmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d280a87b-e6ab-4f0d-b112-bbedc223c9fd@nutanix.com \
    --to=flosch@nutanix.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathan.davies@nutanix.com \
    --cc=liu.denton@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).