Re: [MM] - MF-196 Segmentation fault



On 03/20/2013 06:01 PM, Gonzalez Calabozo, Jose Maria wrote:
So several patches can be applied to fix this issue.
The most simple is just to check the value of msg_errors[i].error:

--- a/src/mm-error-helpers.c
+++ b/src/mm-error-helpers.c
@@ -243,7 +243,7 @@ mm_message_error_for_string (const gchar *str)

     /* Look for the string */
     for (i = 0; i < G_N_ELEMENTS (msg_errors); i++) {
-        if (g_str_equal (msg_errors[i].error, buf)) {
+        if (msg_errors[i].error && g_str_equal (msg_errors[i].error, buf)) {
             code = msg_errors[i].code;
             msg = msg_errors[i].message;
             break;

Actually there's even a simpler fix, which is removing the last element
with NULL pointers :)

Pushed that fix already, thanks.

-- 
Aleksander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]