commit 52ba27b372c79f398a374541cae9f306284131c7 from: Mark Jamsek via: Thomas Adam date: Sun Nov 24 13:41:33 2024 UTC gotwebd: fix UB when path param is not in query Don't pass NULL as a *printf(3) %s conversion specifier argument. If the path parameter is not defined, return repo not found error. ok stsp@ commit - 821d9838d55e92c234e8e7ce7ecccc0ec2809a00 commit + 52ba27b372c79f398a374541cae9f306284131c7 blob - 53cbc91e069a115f4cf2a397a5f0747d68241108 blob + 31ee18120e8ff48e759771834ace3e9acff31e30 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -1068,6 +1068,9 @@ gotweb_load_got_path(struct repo_dir **rp, const char DIR *dt; char *dir_test; + if (dir == NULL) + return got_error(GOT_ERR_NOT_GIT_REPO); + *rp = calloc(1, sizeof(**rp)); if (*rp == NULL) return got_error_from_errno("calloc");