Mercurial > pidgin.yaz
changeset 9916:4d17a945aab3
[gaim-migrate @ 10808]
(19:15:38) datallah: LSchiere: here is that BSS overflow patch
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 30 Aug 2004 23:13:28 +0000 |
parents | 0ddc84d81eac |
children | e74eb0d11f86 |
files | src/util.c src/win32/win32dep.c |
diffstat | 2 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/util.c Mon Aug 30 21:59:25 2004 +0000 +++ b/src/util.c Mon Aug 30 23:13:28 2004 +0000 @@ -1870,8 +1870,9 @@ const gchar *hd = gaim_home_dir(); if (hd) { - strcpy((char*) &home_dir, hd); - strcat((char*) &home_dir, G_DIR_SEPARATOR_S ".gaim"); + g_strlcpy((char*) &home_dir, hd, sizeof(home_dir)); + g_strlcat((char*) &home_dir, G_DIR_SEPARATOR_S ".gaim", + sizeof(home_dir)); } } @@ -1881,7 +1882,8 @@ void set_gaim_user_dir(const char *dir) { if (dir != NULL && strlen(dir) > 0) { - strcpy((char*) &custom_home_dir, dir); + g_strlcpy((char*) &custom_home_dir, dir, + sizeof(custom_home_dir)); } }
--- a/src/win32/win32dep.c Mon Aug 30 21:59:25 2004 +0000 +++ b/src/win32/win32dep.c Mon Aug 30 23:13:28 2004 +0000 @@ -395,13 +395,13 @@ char* wgaim_lib_dir(void) { strcpy(lib_dir, wgaim_install_dir()); - strcat(lib_dir, G_DIR_SEPARATOR_S "plugins"); + g_strlcat(lib_dir, G_DIR_SEPARATOR_S "plugins", sizeof(lib_dir)); return (char*)&lib_dir; } char* wgaim_locale_dir(void) { strcpy(locale_dir, wgaim_install_dir()); - strcat(locale_dir, G_DIR_SEPARATOR_S "locale"); + g_strlcat(locale_dir, G_DIR_SEPARATOR_S "locale", sizeof(locale_dir)); return (char*)&locale_dir; } @@ -594,7 +594,7 @@ move_settings_dir(); } else { - strcpy(app_data_dir, newenv); + g_strlcpy(app_data_dir, newenv, sizeof(app_data_dir)); } gaim_debug(GAIM_DEBUG_INFO, "wgaim", "Gaim settings dir: %s\n", app_data_dir);