aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-17 15:16:18 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-11-19 05:11:41 +0000
commitf59dac7e6d9f0aad961c5686fe832d95ec1e7b6c (patch)
tree9c20621c50cb5aa16658d583e065096b75ba22d1 /file.c
parentPrevent segfault with incorrect form_int fid (diff)
downloadw3m-f59dac7e6d9f0aad961c5686fe832d95ec1e7b6c.tar.gz
w3m-f59dac7e6d9f0aad961c5686fe832d95ec1e7b6c.zip
Prevent segfault with incorrect button type
Bug-Debian: https://github.com/tats/w3m/issues/17 [CVE-2016-9437] Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=67be73b03a5ad581e331ec97cb275cd8a52719ed
Diffstat (limited to '')
-rw-r--r--file.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/file.c b/file.c
index b30aa6b..3b7befe 100644
--- a/file.c
+++ b/file.c
@@ -3756,6 +3756,17 @@ process_button(struct parsed_tag *tag)
if (v == FORM_UNKNOWN)
return NULL;
+ switch (v) {
+ case FORM_INPUT_SUBMIT:
+ case FORM_INPUT_BUTTON:
+ case FORM_INPUT_RESET:
+ break;
+ default:
+ p = "submit";
+ v = FORM_INPUT_SUBMIT;
+ break;
+ }
+
if (!q) {
switch (v) {
case FORM_INPUT_SUBMIT: