[glib/wip/gcleanup] gdbusconnection: Fix invalid memory access
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup] gdbusconnection: Fix invalid memory access
- Date: Sat, 9 Nov 2013 08:24:30 +0000 (UTC)
commit 5c92b0253d6458aaf988c84569df4bfb131dfab8
Author: Stef Walter <stefw gnome org>
Date: Sat Nov 9 09:22:58 2013 +0100
gdbusconnection: Fix invalid memory access
Occurs when the string is zero length.
gio/gdbusconnection.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 9e26319..213ad13 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3792,10 +3792,10 @@ path_rule_matches (const gchar *path_a,
len_a = strlen (path_a);
len_b = strlen (path_b);
- if (len_a < len_b && path_a[len_a - 1] != '/')
+ if (len_a < len_b && (len_a == 0 || path_a[len_a - 1] != '/'))
return FALSE;
- if (len_b < len_a && path_b[len_b - 1] != '/')
+ if (len_b < len_a && (len_b == 0 || path_b[len_b - 1] != '/'))
return FALSE;
return memcmp (path_a, path_b, MIN (len_a, len_b)) == 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]