diff options
author | Jason A. Donenfeld | 2016-01-14 14:31:13 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2016-01-14 14:31:13 +0100 |
commit | 1c581a072651524f3b0d91f33e22a42c4166dd96 (patch) | |
tree | 6f29692870f6c822e37f60b77de61f946d93b747 | |
parent | ui-shared: prevent malicious filename from injecting headers (diff) | |
download | cgit-1c581a072651524f3b0d91f33e22a42c4166dd96.tar.gz cgit-1c581a072651524f3b0d91f33e22a42c4166dd96.zip |
ui-blob: Do not accept mimetype from user
-rw-r--r-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | ui-blob.c | 1 |
3 files changed, 0 insertions, 4 deletions
diff --git a/cgit.c b/cgit.c index 05e5d57..3ed1935 100644 --- a/cgit.c +++ b/cgit.c | |||
@@ -314,8 +314,6 @@ static void querystring_cb(const char *name, const char *value) | |||
314 | ctx.qry.path = trim_end(value, '/'); | 314 | ctx.qry.path = trim_end(value, '/'); |
315 | } else if (!strcmp(name, "name")) { | 315 | } else if (!strcmp(name, "name")) { |
316 | ctx.qry.name = xstrdup(value); | 316 | ctx.qry.name = xstrdup(value); |
317 | } else if (!strcmp(name, "mimetype")) { | ||
318 | ctx.qry.mimetype = xstrdup(value); | ||
319 | } else if (!strcmp(name, "s")) { | 317 | } else if (!strcmp(name, "s")) { |
320 | ctx.qry.sort = xstrdup(value); | 318 | ctx.qry.sort = xstrdup(value); |
321 | } else if (!strcmp(name, "showmsg")) { | 319 | } else if (!strcmp(name, "showmsg")) { |
diff --git a/cgit.h b/cgit.h index b7eccdd..4b4bcf4 100644 --- a/cgit.h +++ b/cgit.h | |||
@@ -173,7 +173,6 @@ struct cgit_query { | |||
173 | char *sha2; | 173 | char *sha2; |
174 | char *path; | 174 | char *path; |
175 | char *name; | 175 | char *name; |
176 | char *mimetype; | ||
177 | char *url; | 176 | char *url; |
178 | char *period; | 177 | char *period; |
179 | int ofs; | 178 | int ofs; |
diff --git a/ui-blob.c b/ui-blob.c index 1ded839..2cce11c 100644 --- a/ui-blob.c +++ b/ui-blob.c | |||
@@ -161,7 +161,6 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl | |||
161 | } | 161 | } |
162 | 162 | ||
163 | buf[size] = '\0'; | 163 | buf[size] = '\0'; |
164 | ctx.page.mimetype = ctx.qry.mimetype; | ||
165 | if (!ctx.page.mimetype) { | 164 | if (!ctx.page.mimetype) { |
166 | if (buffer_is_binary(buf, size)) | 165 | if (buffer_is_binary(buf, size)) |
167 | ctx.page.mimetype = "application/octet-stream"; | 166 | ctx.page.mimetype = "application/octet-stream"; |