fix ITS#5005

This commit is contained in:
Pierangelo Masarati 2007-06-19 13:18:17 +00:00
parent 10264919f4
commit 46ab91eeba

View File

@ -180,7 +180,10 @@ slap_parse_sync_cookie(
if ( !strncmp( next, "rid=", STRLENOF("rid=") )) {
rid_ptr = next;
cookie->rid = strtoul( &rid_ptr[ STRLENOF( "rid=" ) ], &next, 10 );
if ( next == rid_ptr || next > end || *next != ',' ) {
if ( next == rid_ptr ||
next > end ||
( *next && *next != ',' ) )
{
return -1;
}
if ( *next == ',' ) {
@ -194,7 +197,10 @@ slap_parse_sync_cookie(
if ( !strncmp( next, "sid=", STRLENOF("sid=") )) {
rid_ptr = next;
cookie->sid = strtoul( &rid_ptr[ STRLENOF( "sid=" ) ], &next, 16 );
if ( next == rid_ptr || next > end || *next != ',' ) {
if ( next == rid_ptr ||
next > end ||
( *next && *next != ',' ) )
{
return -1;
}
if ( *next == ',' ) {