1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-12 01:14:54 +00:00

Fix a parsing bug which could be triggered by a truncated xml file.

This commit is contained in:
Josh Elsasser 2007-04-26 05:40:24 +00:00
parent 9d570c03db
commit 9aaa36a431

View file

@ -161,6 +161,7 @@ tr_xmlSkipTag( const char * begin, const char * end )
}
else
{
CHECKNULL( begin, end, NULL );
overtag( begin, end, &begin );
return begin;
}
@ -258,6 +259,7 @@ skipall( const char * begin, const char * end, const char ** afterpos )
static int
nexttag( const char * begin, const char * end, const char ** tagpos )
{
*tagpos = NULL;
CHECKNULL( begin, end, 0 );
while( end > begin )
@ -271,15 +273,10 @@ nexttag( const char * begin, const char * end, const char ** tagpos )
{
*tagpos = begin;
begin++;
if( end > begin )
{
return ( TAGCLOSE != *begin );
}
break;
return ( end > begin && TAGCLOSE != *begin );
}
}
*tagpos = NULL;
return 0;
}