summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index c5080246a2f..c190049122c 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1660,6 +1660,13 @@ valid_ipv4_address (char *address, int length, gf_boolean_t wildcard_acc)
int is_wildcard = 0;
tmp = gf_strdup (address);
+
+ /* To prevent cases where last character is '.' */
+ if (!isdigit (tmp[length - 1]) && (tmp[length - 1] != '*')) {
+ ret = 0;
+ goto out;
+ }
+
prev = tmp;
prev = strtok_r (tmp, ".", &ptr);