comparison mcabber/mcabber/utils.c @ 1859:a20701a2840c

"." is not a valid Jabber domain name
author Mikael Berthe <mikael@lilotux.net>
date Sat, 03 Apr 2010 17:07:27 +0200
parents e6d355e50d7a
children efd7c4c34ff2
comparison
equal deleted inserted replaced
1858:663cd6c38cdc 1859:a20701a2840c
501 if (domlen == 0) return 1; 501 if (domlen == 0) return 1;
502 502
503 /* and it must not be longer than 1023 bytes */ 503 /* and it must not be longer than 1023 bytes */
504 if (domlen > 1023) return 1; 504 if (domlen > 1023) return 1;
505 505
506 /* /.+/ is not a valid domain name pattern */
507 for (str = domain; *str && *str != JID_RESOURCE_SEPARATOR; str++)
508 if (*str != '.') break;
509 if (!*str || *str == JID_RESOURCE_SEPARATOR)
510 return 1; /* domain contains only dots */
511
506 #ifdef HAVE_LIBIDN 512 #ifdef HAVE_LIBIDN
507 idnpp = idnprep; 513 idnpp = idnprep;
508 str = domain; 514 str = domain;
509 while (*str != '\0' && *str != JID_RESOURCE_SEPARATOR) 515 while (*str != '\0' && *str != JID_RESOURCE_SEPARATOR)
510 *idnpp++ = *str++; 516 *idnpp++ = *str++;