aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-17 15:16:18 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-17 15:21:08 +0000
commit67be73b03a5ad581e331ec97cb275cd8a52719ed (patch)
treee5cdb3f7d194e790d28bf15bc268e01fbbd75461
parentPrevent segfault with incorrect form_int fid (diff)
downloadw3m-67be73b03a5ad581e331ec97cb275cd8a52719ed.tar.gz
w3m-67be73b03a5ad581e331ec97cb275cd8a52719ed.zip
Prevent segfault with incorrect button type
Bug-Debian: https://github.com/tats/w3m/issues/17
-rw-r--r--file.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/file.c b/file.c
index 265315f..ddc080f 100644
--- a/file.c
+++ b/file.c
@@ -3773,6 +3773,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: