Commit Diff
- Commit:
f03e60a991b6bf54e115e3d187aede52f52ef56c
- From:
- Mark Jamsek <mark@jamsek.dev>
- 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 @@ -1069,6 +1069,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");