Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -108,12 +108,13 @@ [old release]; node = nil; return; } - if ((rc = stringprep_profile([node_ UTF8String], &nodepart, - "Nodeprep", 0)) != STRINGPREP_OK) + if (((rc = stringprep_profile([node_ UTF8String], &nodepart, + "Nodeprep", 0)) != STRINGPREP_OK) || (nodepart[0] == '\0') || + (strnlen(nodepart, 1024) > 1023)) @throw [XMPPStringPrepFailedException exceptionWithClass: isa connection: nil profile: @"Nodeprep" string: node_]; @@ -136,12 +137,13 @@ { OFString *old = domain; char *srv; Stringprep_rc rc; - if ((rc = stringprep_profile([domain_ UTF8String], &srv, - "Nameprep", 0)) != STRINGPREP_OK) + if (((rc = stringprep_profile([domain_ UTF8String], &srv, + "Nameprep", 0)) != STRINGPREP_OK) || (srv[0] == '\0') || + (strnlen(srv, 1024) > 1023)) @throw [XMPPStringPrepFailedException exceptionWithClass: isa connection: nil profile: @"Nameprep" string: domain_]; @@ -170,12 +172,13 @@ [old release]; resource = nil; return; } - if ((rc = stringprep_profile([resource_ UTF8String], &res, - "Resourceprep", 0)) != STRINGPREP_OK) + if (((rc = stringprep_profile([resource_ UTF8String], &res, + "Resourceprep", 0)) != STRINGPREP_OK) || (res[0] == '\0') || + (strnlen(res, 1024) > 1023)) @throw [XMPPStringPrepFailedException exceptionWithClass: isa connection: nil profile: @"Resourceprep" string: resource_];