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>
This commit is contained in:
Aleksander Morgado
2013-03-20 18:16:10 +01:00
parent f27dbda4a7
commit 0b39072b76

View File

@@ -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 *