diff options
author | portix <none@none> | 2012-12-06 01:43:28 +0100 |
---|---|---|
committer | portix <none@none> | 2012-12-06 01:43:28 +0100 |
commit | 007e4f7a1a0918c7728f98fa501e8313cf0826da (patch) | |
tree | 043b3a519056d09004bff064bfe3e1a32365fa85 /src/local.c | |
parent | 2d2a9936443d1ade647adce3fef90a8c9f1d8ffa (diff) | |
download | dwb-007e4f7a1a0918c7728f98fa501e8313cf0826da.zip |
Fixing use after free in dwb_get_scripts
Diffstat (limited to 'src/local.c')
-rw-r--r-- | src/local.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/local.c b/src/local.c index 32a9a43a..f664aa9a 100644 --- a/src/local.c +++ b/src/local.c @@ -258,7 +258,8 @@ local_show_directory(GList *gl, const char *path, gboolean add_to_history) } tmp = orig_path+1; GString *path_buffer = g_string_new("/<a class='dwb_local_headline' href='"); - while ((match = strchr(tmp, '/'))) { + while ((match = strchr(tmp, '/'))) + { g_string_append_len(path_buffer, orig_path, match-orig_path); g_string_append(path_buffer, "'>"); g_string_append_len(path_buffer, tmp, match-tmp); @@ -286,10 +287,11 @@ local_show_directory(GList *gl, const char *path, gboolean add_to_history) g_string_free(path_buffer, true); fullpath = g_strdup_printf("file://%s", orig_path); + /* add a history item */ - /* TODO sqlite */ WebKitWebView *web = WEBVIEW(gl); - if (add_to_history) { + if (add_to_history) + { WebKitWebBackForwardList *bf_list = webkit_web_view_get_back_forward_list(web); WebKitWebHistoryItem *item = webkit_web_history_item_new_with_data(fullpath, fullpath); webkit_web_back_forward_list_add_item(bf_list, item); |