aboutsummaryrefslogtreecommitdiff
path: root/src/mm-error-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-03-20 18:16:10 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-03-20 18:16:10 +0100
commit0b39072b76cc5cca1dd84a7db079b4d6db3386cb (patch)
tree34afe24ec427ddee00af7583c737a8cc675627c2 /src/mm-error-helpers.c
parentf27dbda4a7b21aa4093d71c3886e67ca614e4f64 (diff)
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 <jmgonzalezc@indra.es>
Diffstat (limited to 'src/mm-error-helpers.c')
-rw-r--r--src/mm-error-helpers.c3
1 files changed, 1 insertions, 2 deletions
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 *