[glib] Guard g_inet_address_mask_equal against invalid input
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Guard g_inet_address_mask_equal against invalid input
- Date: Sun, 26 Oct 2014 15:44:14 +0000 (UTC)
commit 92d67358986c3be48ccbd4135b53ea591f15ea86
Author: Erik van Pienbroek <epienbro fedoraproject org>
Date: Thu Jul 17 18:37:04 2014 +0200
Guard g_inet_address_mask_equal against invalid input
https://bugzilla.gnome.org/show_bug.cgi?id=733338
gio/ginetaddressmask.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/ginetaddressmask.c b/gio/ginetaddressmask.c
index b33c2f9..f717c77 100644
--- a/gio/ginetaddressmask.c
+++ b/gio/ginetaddressmask.c
@@ -465,6 +465,9 @@ gboolean
g_inet_address_mask_equal (GInetAddressMask *mask,
GInetAddressMask *mask2)
{
+ g_return_val_if_fail (G_IS_INET_ADDRESS_MASK (mask), FALSE);
+ g_return_val_if_fail (G_IS_INET_ADDRESS_MASK (mask2), FALSE);
+
return ((mask->priv->length == mask2->priv->length) &&
g_inet_address_equal (mask->priv->addr, mask2->priv->addr));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]