commit - aa309cb072eb85f42a5852b52747d7096b076d31
commit + 19ff763832b00e92bebdb791841067448f12bbcd
blob - f4118d21a05f1ce2274e9431d325494197e92754
blob + ecbcccb4caeee69553877a5f7e6aff81f77b5b7b
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
href_summary = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_dir->name, "action", "summary", NULL);
+ if (href_summary == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID,
"index_project", KATTR__MAX);
if (kerr != KCGI_OK)
href_briefs = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_dir->name, "action", "briefs", NULL);
+ if (href_briefs == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_briefs, KATTR__MAX);
if (kerr != KCGI_OK)
href_commits = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_dir->name, "action", "commits", NULL);
+ if (href_commits == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_commits, KATTR__MAX);
if (kerr != KCGI_OK)
href_tags = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_dir->name, "action", "tags", NULL);
+ if (href_tags == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_tags, KATTR__MAX);
if (kerr != KCGI_OK)
href_tree = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_dir->name, "action", "tree", NULL);
+ if (href_tree == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_tree, KATTR__MAX);
if (kerr != KCGI_OK)
prev_disp == gw_trans->repos_total)) {
href_prev = khttp_urlpartx(NULL, NULL, "gotweb", "page",
KATTRX_INT, (int64_t)(gw_trans->page - 1), NULL);
+ if (href_prev == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_prev, KATTR__MAX);
if (kerr != KCGI_OK)
goto done;
href_next = khttp_urlpartx(NULL, NULL, "gotweb", "page",
KATTRX_INT, (int64_t)(gw_trans->page + 1), NULL);
+ if (href_next == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_next, KATTR__MAX);
if (kerr != KCGI_OK)
href_diff = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "diff", "commit",
n_header->commit_id, NULL);
+ if (href_diff == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "navs_wrapper", KATTR__MAX);
if (kerr != KCGI_OK)
href_tree = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "tree", "commit",
- n_header->commit_id, NULL),
+ n_header->commit_id, NULL);
+ if (href_tree == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_tree, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->prev_id ? gw_trans->prev_id : "", "prev",
KATTRX_STRING, gw_trans->prev_prev_id ?
gw_trans->prev_prev_id : "", NULL);
+ if (href_prev == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_prev, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->next_id, "prev", KATTRX_STRING,
gw_trans->next_prev_id ? gw_trans->next_prev_id : "",
"prev_prev", KATTRX_STRING, gw_trans->prev_prev_id ?
- gw_trans->prev_prev_id : "", NULL),
+ gw_trans->prev_prev_id : "", NULL);
+ if (href_next == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_next, KATTR__MAX);
if (kerr != KCGI_OK)
href_diff = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "diff", "commit",
n_header->commit_id, NULL);
+ if (href_diff == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "briefs_log", KATTR__MAX);
if (kerr != KCGI_OK)
href_tree = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "tree", "commit",
n_header->commit_id, NULL);
+ if (href_tree == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_tree, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->prev_id ? gw_trans->prev_id : "", "prev",
KATTRX_STRING, gw_trans->prev_prev_id ?
gw_trans->prev_prev_id : "", NULL);
+ if (href_prev == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_prev, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->next_id, "prev", KATTRX_STRING,
gw_trans->next_prev_id ? gw_trans->next_prev_id : "",
"prev_prev", KATTRX_STRING, gw_trans->prev_id ?
- gw_trans->prev_id : "", NULL),
+ gw_trans->prev_id : "", NULL);
+ if (href_next == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_next, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->prev_id ? gw_trans->prev_id : "", "prev",
KATTRX_STRING, gw_trans->prev_prev_id ?
gw_trans->prev_prev_id : "", NULL);
+ if (href_prev == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_prev, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->next_prev_id ? gw_trans->next_prev_id : "",
"prev_prev", KATTRX_STRING, gw_trans->prev_id ?
gw_trans->prev_id : "", NULL);
+ if (href_next == NULL) {
+ error = got_error_from_errno("khttp_urlpartx");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_next, KATTR__MAX);
if (kerr != KCGI_OK)
href_tag = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "tag", "commit",
id_str, NULL);
+ if (href_tag == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_tag, KATTR__MAX);
if (kerr != KCGI_OK)
href_briefs = khttp_urlpart(NULL, NULL, "gotweb",
"path", gw_trans->repo_name, "action", "briefs",
"commit", id_str, NULL);
+ if (href_briefs == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_briefs, KATTR__MAX);
if (kerr != KCGI_OK)
href_commits = khttp_urlpart(NULL, NULL, "gotweb",
"path", gw_trans->repo_name, "action", "commits",
"commit", id_str, NULL);
+ if (href_commits == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_commits, KATTR__MAX);
if (kerr != KCGI_OK)
href_diff = khttp_urlpart(NULL, NULL, "gotweb", "path",
a->gw_trans->repo_name, "action", "diff", "commit",
bline->id_str, NULL);
+ if (href_diff == NULL) {
+ err = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(a->gw_trans->gw_html_req, KELEM_A,
KATTR_HREF, href_diff, KATTR__MAX);
if (kerr != KCGI_OK)
gw_trans->repo_name, "action",
gw_get_action_name(gw_trans), "commit",
gw_trans->commit_id, "folder", build_folder, NULL);
+ if (href_blob == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "tree_wrapper", KATTR__MAX);
if (kerr != KCGI_OK)
got_tree_entry_get_name(te), "folder",
gw_trans->repo_folder ? gw_trans->repo_folder : "",
NULL);
+ if (href_blob == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
href_blame = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "blame", "commit",
gw_trans->commit_id, "file",
got_tree_entry_get_name(te), "folder",
gw_trans->repo_folder ? gw_trans->repo_folder : "",
NULL);
+ if (href_blame == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV,
KATTR_ID, "tree_wrapper", KATTR__MAX);
if (kerr != KCGI_OK)
href_summary = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "summary", "headref",
- refname, NULL),
+ refname, NULL);
+ if (href_summary == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_summary, KATTR__MAX);
kerr = khtml_puts(gw_trans->gw_html_req, refname);
href_briefs = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "briefs", "headref",
refname, NULL);
+ if (href_briefs == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_briefs, KATTR__MAX);
if (kerr != KCGI_OK)
href_commits = khttp_urlpart(NULL, NULL, "gotweb", "path",
gw_trans->repo_name, "action", "commits", "headref",
- refname, NULL),
+ refname, NULL);
+ if (href_commits == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_commits, KATTR__MAX);
if (kerr != KCGI_OK)
goto done;
href_summary = khttp_urlpart(NULL, NULL, "gotweb", "path",
- gw_trans->repo_name, "action", "summary", NULL),
+ gw_trans->repo_name, "action", "summary", NULL);
+ if (href_summary == NULL) {
+ error = got_error_from_errno("khttp_urlpart");
+ goto done;
+ }
kerr = khtml_attr(gw_trans->gw_html_req, KELEM_A, KATTR_HREF,
href_summary, KATTR__MAX);
if (kerr != KCGI_OK)