ObjXMPP  Check-in [3b429b0df5]

Overview
Comment:Perform length checking on JID parts (0 < part < 1024)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3b429b0df5ee7b958c9955d43ad12c39b98785578bbf13f483943667bb389279
User & Date: florob@babelmonkeys.de on 2012-01-25 16:20:28
Other Links: manifest | tags
Context
2012-01-25
17:06
Use strlen instead of strnlen, for compatibility with some systems check-in: 7545a302b7 user: florob@babelmonkeys.de tags: trunk
16:20
Perform length checking on JID parts (0 < part < 1024) check-in: 3b429b0df5 user: florob@babelmonkeys.de tags: trunk
15:42
Implement SASL EXTERNAL check-in: 1f5b2b1bd8 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPJID.m from [f46e581111] to [431d7306de].

106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121

	if (node_ == nil) {
		[old release];
		node = nil;
		return;
	}

	if ((rc = stringprep_profile([node_ UTF8String], &nodepart,
	    "Nodeprep", 0)) != STRINGPREP_OK)

		@throw [XMPPStringPrepFailedException
		    exceptionWithClass: isa
			    connection: nil
			       profile: @"Nodeprep"
				string: node_];

	@try {







|
|
>







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

	if (node_ == nil) {
		[old release];
		node = nil;
		return;
	}

	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_];

	@try {
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149

- (void)setDomain: (OFString*)domain_
{
	OFString *old = domain;
	char *srv;
	Stringprep_rc rc;

	if ((rc = stringprep_profile([domain_ UTF8String], &srv,
	    "Nameprep", 0)) != STRINGPREP_OK)

		@throw [XMPPStringPrepFailedException
		    exceptionWithClass: isa
			    connection: nil
			       profile: @"Nameprep"
				string: domain_];

	@try {







|
|
>







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

- (void)setDomain: (OFString*)domain_
{
	OFString *old = domain;
	char *srv;
	Stringprep_rc rc;

	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_];

	@try {
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183

	if (resource_ == nil) {
		[old release];
		resource = nil;
		return;
	}

	if ((rc = stringprep_profile([resource_ UTF8String], &res,
	    "Resourceprep", 0)) != STRINGPREP_OK)

		@throw [XMPPStringPrepFailedException
		    exceptionWithClass: isa
			    connection: nil
			       profile: @"Resourceprep"
				string: resource_];

	@try {







|
|
>







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

	if (resource_ == nil) {
		[old release];
		resource = nil;
		return;
	}

	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_];

	@try {