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-11-19 05:11:40 +0000
commitf92e9ed28f277ec870e2786e707852ab7d4292a6 (patch)
tree32bd3ef909608d7bf700c4ce0e619b72e2afce39 /file.c
parentFix segfault on bogus text for wc_N_to_johab1 (diff)
downloadw3m-f92e9ed28f277ec870e2786e707852ab7d4292a6.tar.gz
w3m-f92e9ed28f277ec870e2786e707852ab7d4292a6.zip
Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 [CVE-2016-9430] Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=59b91cd8e30c86f23476fa81ae005cabff49ebb6
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/file.c b/file.c
index 1e363d0..d06b2cf 100644
--- a/file.c
+++ b/file.c
@@ -3622,9 +3622,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), w, i, qq));
+ cur_hseq++, cur_form_id, html_quote(p),
+ html_quote(r), w, i, qq));
if (x)
Strcat_charp(tmp, " checked");
if (y)
@@ -3772,9 +3773,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;
}