From: Pierangelo Masarati Date: Tue, 19 Jun 2007 13:18:17 +0000 (+0000) Subject: fix ITS#5005 X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~373 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=46ab91eeba1f2cfbe569a0717876f02025b22bf9;p=openldap fix ITS#5005 --- diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index 5870635a69..840a3c131d 100644 --- a/servers/slapd/ldapsync.c +++ b/servers/slapd/ldapsync.c @@ -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 == ',' ) {