Thread (1 message) 1 message, 1 author, 2024-02-08

Re: [PATCH] commit.c: ensure strchrnul() doesn't scan beyond range

From: Junio C Hamano <hidden>
Date: 2024-02-08 21:44:51

Jeff King [off-list ref] writes:
  1. It is not possible for the buf/len pair we pass to check_nonce() to
     contain a NUL. And thus there is no caller of find_header_mem()
     that can contain an embedded NUL. So switching from strchrnul() to
     just memchr() should be OK there.
Correct.
  2. That raises the question of whether parse_signed_buffer() has a
     similar walk-too-far problem. ;) The answer is no, because we feed
     it from a strbuf. But it's not a great pattern overall.
True, too.

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