aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-05-06 10:51:01 -0500
committerDan Williams <dcbw@redhat.com>2013-05-06 10:51:01 -0500
commitc4fa405e2e3c66ca69594cef7f0f517da94a5ff7 (patch)
treea5321fa69e6686d0b39f17813759b7dc16e82215
parent9bbcd9d6a5d0b01e16bdd4f94f707f0341f73e24 (diff)
sms: enforce message 'class' value validity
Class is -1 to 3, so warn about out-of-bounds values when it's being set on the client side.
-rw-r--r--libmm-glib/mm-sms-properties.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmm-glib/mm-sms-properties.c b/libmm-glib/mm-sms-properties.c
index a6947269..d6a74168 100644
--- a/libmm-glib/mm-sms-properties.c
+++ b/libmm-glib/mm-sms-properties.c
@@ -318,7 +318,7 @@ mm_sms_properties_get_validity_relative (MMSmsProperties *self)
/**
* mm_sms_properties_set_class:
* @self: A #MMSmsProperties.
- * @class: The message class, or -1 for invalid/unset class.
+ * @class: The message class (0..3), or -1 for invalid/unset class.
*
* Sets the 3GPP message class of the SMS.
*/
@@ -327,6 +327,7 @@ mm_sms_properties_set_class (MMSmsProperties *self,
gint class)
{
g_return_if_fail (MM_IS_SMS_PROPERTIES (self));
+ g_return_if_fail (class >= -1 && class <= 3);
self->priv->class = class;
}