aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-08 15:02:24 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-08 15:02:24 +0000
commit59b91cd8e30c86f23476fa81ae005cabff49ebb6 (patch)
tree47338802031194957f0359bc2c55380b00f378fa /file.c
parentUpdate ChangeLog (diff)
downloadw3m-59b91cd8e30c86f23476fa81ae005cabff49ebb6.tar.gz
w3m-59b91cd8e30c86f23476fa81ae005cabff49ebb6.zip
Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7
Diffstat (limited to '')
-rw-r--r--file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/file.c b/file.c
index e26f383..7d76b6a 100644
--- a/file.c
+++ b/file.c
@@ -3639,9 +3639,10 @@ process_input(struct parsed_tag *tag)
Strcat(tmp, getLinkNumberStr(0));
Strcat_char(tmp, '(');
}
- Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=%s "
+ Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=\"%s\" "
"name=\"%s\" width=%d maxlength=%d value=\"%s\"",
- cur_hseq++, cur_form_id, p, html_quote(r), size, i, qq));
+ cur_hseq++, cur_form_id, html_quote(p),
+ html_quote(r), size, i, qq));
if (x)
Strcat_charp(tmp, " checked");
if (y)
@@ -3789,9 +3790,10 @@ process_button(struct parsed_tag *tag)
}
/* Strcat_charp(tmp, "<pre_int>"); */
- Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=%s "
+ Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=\"%s\" "
"name=\"%s\" value=\"%s\">",
- cur_hseq++, cur_form_id, p, html_quote(r), qq));
+ cur_hseq++, cur_form_id, html_quote(p),
+ html_quote(r), qq));
return tmp;
}