Merge branch 'en/serve-promisor-remote-fix'
A client requesting the promisor-remote capability without a value caused a null pointer dereference, which has been corrected by rejecting a request without an argument. * en/serve-promisor-remote-fix: serve: reject valueless promisor-remote capabilitymain
commit
bc4c56690e
3
serve.c
3
serve.c
|
|
@ -46,6 +46,9 @@ static int promisor_remote_advertise(struct repository *r,
|
||||||
static void promisor_remote_receive(struct repository *r,
|
static void promisor_remote_receive(struct repository *r,
|
||||||
const char *remotes)
|
const char *remotes)
|
||||||
{
|
{
|
||||||
|
if (!remotes)
|
||||||
|
die("promisor-remote capability requires an argument");
|
||||||
|
|
||||||
mark_promisor_remotes_as_accepted(r, remotes);
|
mark_promisor_remotes_as_accepted(r, remotes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,17 @@ test_expect_success 'request invalid capability' '
|
||||||
test_grep "unknown capability" err
|
test_grep "unknown capability" err
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'promisor-remote capability requires an argument' '
|
||||||
|
test-tool pkt-line pack >in <<-EOF &&
|
||||||
|
command=ls-refs
|
||||||
|
object-format=$(test_oid algo)
|
||||||
|
promisor-remote
|
||||||
|
0000
|
||||||
|
EOF
|
||||||
|
test_must_fail test-tool serve-v2 --stateless-rpc 2>err <in &&
|
||||||
|
test_grep "promisor-remote capability requires an argument" err
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'request with no command' '
|
test_expect_success 'request with no command' '
|
||||||
test-tool pkt-line pack >in <<-EOF &&
|
test-tool pkt-line pack >in <<-EOF &&
|
||||||
agent=git/test
|
agent=git/test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue