* Copyright © 2010 Codethink Limited
* Copyright © 2010 Novell, Inc.
*
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
GHashTable *system_locks; /* Used as a set, owning the strings it contains */
gchar *prefix;
- gint prefix_len;
+ gsize prefix_len;
gchar *root_group;
- gint root_group_len;
+ gsize root_group_len;
GFile *file;
GFileMonitor *file_monitor;
/* if a root_group was specified, make sure the user hasn't given
* a path that ghosts that group name
*/
- if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
+ if (last_slash != NULL && last_slash - key >= 0 &&
+ (gsize) (last_slash - key) == kfsb->root_group_len &&
+ memcmp (key, kfsb->root_group, last_slash - key) == 0)
return FALSE;
}
else