commit 35bfe2979688008d12691f564ced7e5531e1d57b
parent 6a1521ae37726f05cb3ddeb1cee4a5d56eb00e06
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Sat, 29 Dec 2018 15:51:35 +0100
Fix incorrect pointer arithmetic in w32_filesel.c
This caused the lpstrFilter parameter to be set up
incorrectly, and a buffer overflow.
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/gtk/w32_filesel.c b/src/gtk/w32_filesel.c
@@ -169,8 +169,7 @@ static const gboolean _file_open_dialog(const gchar *path, const gchar *title,
sz = sizeof(gunichar2);
win_filter16 = g_malloc0(conv_items*sz*2 + sz*3);
memcpy(win_filter16, filter16, conv_items*sz);
- memcpy(win_filter16 + conv_items*sz + sz, filter16, conv_items*sz);
- g_free(filter16);
+ memcpy(win_filter16 + conv_items + 1, filter16, conv_items*sz);
if (error != NULL) {
debug_print("dialog title '%s' conversion to UTF-16 failed\n", title);