Commit Diff
- Commit:
52ba27b372c79f398a374541cae9f306284131c7
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
- Message:
- 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@
- Actions:
- Patch | Tree
--- 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");