From 01949bc965a93a28f0b3cbc6cfbf76dc9d0367bb Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 26 Nov 2002 07:11:22 +0000 Subject: w3m 0.3.2 branch: security fix * frame.c (createFrameFile): html_quote() From: Hironori SAKAMOTO --- frame.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'frame.c') diff --git a/frame.c b/frame.c index 7337b18..5476588 100644 --- a/frame.c +++ b/frame.c @@ -1,4 +1,4 @@ -/* $Id: frame.c,v 1.17 2002/11/05 15:56:13 ukai Exp $ */ +/* $Id: frame.c,v 1.16.4.1 2002/11/26 07:11:22 ukai Exp $ */ #include "fm.h" #include "parsetagx.h" #include "myctype.h" @@ -519,14 +519,15 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, frame.body->attr = F_UNLOADED; if (frame.body->flags & FB_NO_BUFFER) fprintf(f1, "Open %s with other method", - frame.body->url); + html_quote(frame.body->url)); else if (frame.body->url) - fprintf(f1, "Can't open %s", frame.body->url); + fprintf(f1, "Can't open %s", + html_quote(frame.body->url)); else fprintf(f1, "This frame (%s) contains no src attribute", - frame.body->name ? frame.body-> - name : "(no name)"); + frame.body->name ? html_quote(frame.body->name) + : "(no name)"); break; } parseURL2(frame.body->url, &base, currentURL); @@ -620,7 +621,7 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, /* prohibit_tags */ Strshrinkfirst(tok, 1); Strshrink(tok, 1); - fprintf(f1, "", tok->ptr); + fprintf(f1, "", html_quote(tok->ptr)); goto token_end; case HTML_TABLE: t_stack++; @@ -633,7 +634,7 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, Strshrink(tok, 1); fprintf(f1, "", - tok->ptr); + html_quote(tok->ptr)); goto token_end; } break; @@ -653,7 +654,8 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, if (!t_stack) { Strshrinkfirst(tok, 1); Strshrink(tok, 1); - fprintf(f1, "", tok->ptr); + fprintf(f1, "", + html_quote(tok->ptr)); goto token_end; } @@ -790,7 +792,6 @@ renderFrame(Buffer *Cbuf, int force_reload) buf->document_code = Cbuf->document_code; #endif copyParsedURL(&buf->currentURL, &Cbuf->currentURL); - preFormUpdateBuffer(buf); return buf; } -- cgit v1.2.3