commit 04f43d6dfa9bdbdf781811a2daebf20fc880ef32 from: Omar Polo via: Thomas Adam date: Wed Nov 27 20:56:51 2024 UTC gotwebd: bubble up null dir check; ok jamsek commit - 278c2ee8f22638aca522d05826589261d36409b8 commit + 04f43d6dfa9bdbdf781811a2daebf20fc880ef32 blob - 31ee18120e8ff48e759771834ace3e9acff31e30 blob + 01a4395ff59d37c5692a1f5154fcc8327f3f6d07 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -194,6 +194,11 @@ gotweb_process_request(struct request *c) } if (qs->action != INDEX) { + if (qs->path == NULL) { + error = got_error(GOT_ERR_BAD_QUERYSTRING); + goto err; + } + error = gotweb_load_got_path(&repo_dir, qs->path, c); c->t->repo_dir = repo_dir; if (error) @@ -1068,9 +1073,6 @@ 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");