diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index b44c1d0b370..ab3674eadec 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1784,6 +1784,14 @@ valid_host_name (char *address, int length) goto out; } + /* Check for consecutive dots, which is invalid in a hostname and is + * ignored by strtok() + */ + if (strstr (dup_addr, "..")) { + ret = 0; + goto out; + } + /* gen-name */ temp_str = strtok_r (dup_addr, ".", &save_ptr); do { |