From 6d39b569c700ddfa405c5c9a7a49320be2945997 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 17 Aug 2012 20:26:00 +0100 Subject: Pass content containing form's nsurl to form_submit, instead of its hlcache_handle. Avoid dereferencing bw in html content handlers. --- render/form.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'render/form.c') diff --git a/render/form.c b/render/form.c index 40e95ea31..09579dc5b 100644 --- a/render/form.c +++ b/render/form.c @@ -1460,7 +1460,7 @@ void form_radio_set(hlcache_handle *content, * Collect controls and submit a form. */ -void form_submit(hlcache_handle *h, struct browser_window *target, +void form_submit(nsurl *page_url, struct browser_window *target, struct form *form, struct form_control *submit_button) { char *data = NULL, *url = NULL; @@ -1507,8 +1507,7 @@ void form_submit(hlcache_handle *h, struct browser_window *target, url_destroy_components(&components); - browser_window_go(target, url, nsurl_access(hlcache_handle_get_url(h)), - true); + browser_window_go(target, url, nsurl_access(page_url), true); break; case method_POST_URLENC: @@ -1520,14 +1519,12 @@ void form_submit(hlcache_handle *h, struct browser_window *target, } browser_window_go_post(target, form->action, data, 0, - true, nsurl_access(hlcache_handle_get_url(h)), - false, true, 0); + true, nsurl_access(page_url), false, true, 0); break; case method_POST_MULTIPART: - browser_window_go_post(target, form->action, 0, - success, true, nsurl_access(hlcache_handle_get_url(h)), - false, true, 0); + browser_window_go_post(target, form->action, 0, success, + true, nsurl_access(page_url), false, true, 0); break; } -- cgit v1.2.3