comparison libpurple/protocols/msn/slp.c @ 27817:bf7039a638b7

Set a maximum conversion length to g_convert when determining the file name for a MSN transfer.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 04 Aug 2009 03:51:30 +0000
parents 6c4e816873f7
children 769142e728ec
comparison
equal deleted inserted replaced
27816:0cd438c47ab3 27817:bf7039a638b7
339 if (xfer) 339 if (xfer)
340 { 340 {
341 bin = (char *)purple_base64_decode(context, &bin_len); 341 bin = (char *)purple_base64_decode(context, &bin_len);
342 file_size = GUINT32_FROM_LE(*(gsize *)(bin + 8)); 342 file_size = GUINT32_FROM_LE(*(gsize *)(bin + 8));
343 343
344 file_name = g_convert(bin + 20, -1, "UTF-8", "UTF-16LE", 344 file_name = g_convert(bin + 20, MAX_FILE_NAME_LEN, "UTF-8", "UTF-16LE",
345 NULL, NULL, NULL); 345 NULL, NULL, &error);
346 346
347 g_free(bin); 347 g_free(bin);
348 348
349 purple_xfer_set_filename(xfer, file_name); 349 purple_xfer_set_filename(xfer, file_name);
350 g_free(file_name); 350 g_free(file_name);