From 0b39072b76cc5cca1dd84a7db079b4d6db3386cb Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 20 Mar 2013 18:16:10 +0100 Subject: error-helpers: avoid crash when error is not recognized Just remove the last element with NULL strings in the array of errors, as we're safe using G_N_ELEMENTS() to iterate it. Reported by Jose Maria Gonzalez Calabozo --- src/mm-error-helpers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mm-error-helpers.c') diff --git a/src/mm-error-helpers.c b/src/mm-error-helpers.c index 06eb4ed9..6e63b1b1 100644 --- a/src/mm-error-helpers.c +++ b/src/mm-error-helpers.c @@ -198,8 +198,7 @@ static ErrorTable msg_errors[] = { { MM_MESSAGE_ERROR_NO_NETWORK, "nonetwork", "No network" }, { MM_MESSAGE_ERROR_NETWORK_TIMEOUT, "networktimeout", "Network timeout" }, { MM_MESSAGE_ERROR_NO_CNMA_ACK_EXPECTED, "nocnmaackexpected", "No CNMA acknowledgement expected" }, - { MM_MESSAGE_ERROR_UNKNOWN, "unknown", "Unknown" }, - { -1, NULL, NULL } + { MM_MESSAGE_ERROR_UNKNOWN, "unknown", "Unknown" } }; GError * -- cgit v1.2.3-70-g09d2