From 7cd13920d00abbb4b19e64fa13f5ebed80c04a37 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Wed, 22 May 2013 12:21:36 +0300 Subject: client: Fix minor issues in D-Bus path name checking --- client/commands.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/commands.c b/client/commands.c index 8c67ebc6..bd33284d 100644 --- a/client/commands.c +++ b/client/commands.c @@ -73,10 +73,11 @@ static bool check_dbus_name(const char *name) */ unsigned int i; - if (name == NULL || (name[0] >= '0' && name[0] <= '9')) + if (name == NULL || name[0] == '\0' || (name[0] >= '0' && + name[0] <= '9')) return false; - for (i = 0; i < strlen(name); i++) + for (i = 0; name[i] != '\0'; i++) if (!((name[i] >= 'A' && name[i] <= 'Z') || (name[i] >= 'a' && name[i] <= 'z') || (name[i] >= '0' && name[i] <= '9') || -- cgit v1.2.3