receive-pack: use find_commit_header() in check_nonce()
commit020456cb744b16f686d9220eb4b95a8e157c3485
authorRené Scharfe <l.s.r@web.de>
Fri, 9 Feb 2024 20:41:47 +0000 (9 21:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Feb 2024 17:22:20 +0000 (12 09:22 -0800)
tree48f3c1a83576091398b3ad29b131b69294b3c07d
parentf51d790b67255dd40b55654527fc4f59a53f44b0
receive-pack: use find_commit_header() in check_nonce()

Use the public function find_commit_header() and remove find_header(),
as it becomes unused.  This is safe and appropriate because we pass the
NUL-terminated payload buffer to check_nonce() instead of its start and
length.  The underlying strbuf push_cert cannot contain NULs, as it is
built using strbuf_addstr(), only.

We no longer need to call strlen(), as find_commit_header() returns the
length of nonce already.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c