ObjFW  Check-in [0cc997a1d7]

Overview
Comment:OFXMLParser: Don't allow character data before the document.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0cc997a1d77df702e1db881366ef44e556453437c9743a033d6b054b7dd402cf
User & Date: js on 2011-04-09 15:41:20
Other Links: manifest | tags
Context
2011-04-09
15:43
OFXMLParser: Allow processing instructions after the document. check-in: 2d7725aa27 user: js tags: trunk
15:41
OFXMLParser: Don't allow character data before the document. check-in: 0cc997a1d7 user: js tags: trunk
12:30
Also test comments in -[stringValue]. check-in: 91d438b5d2 user: js tags: trunk
Changes

Modified src/OFXMLParser.m from [e1f46dcc8c] to [3ea5992642].

274
275
276
277
278
279
280
281
282

283
284
285
286
287
288
289
/* Not in a tag */
- (void)_parseOutsideTagWithBuffer: (const char*)buf
				 i: (size_t*)i
			      last: (size_t*)last
{
	size_t len;

	if (finishedParsing && buf[*i] != ' ' && buf[*i] != '\t' &&
	    buf[*i] != '\n' && buf[*i] != '\r' && buf[*i] != '<')

		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	if (buf[*i] != '<')
		return;

	if ((len = *i - *last) > 0)







|
|
>







274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/* Not in a tag */
- (void)_parseOutsideTagWithBuffer: (const char*)buf
				 i: (size_t*)i
			      last: (size_t*)last
{
	size_t len;

	if ((finishedParsing || [previous count] < 1) && buf[*i] != ' ' &&
	    buf[*i] != '\t' && buf[*i] != '\n' && buf[*i] != '\r' &&
	    buf[*i] != '<')
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: self];

	if (buf[*i] != '<')
		return;

	if ((len = *i - *last) > 0)