talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit f63d7103445e173946db3c88a7c08a436fad5af6
parent a847751979e192e68fd2c2b55e77d773843d5d93
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:
Msrc/gtk/w32_filesel.c | 3+--
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);