From 46ab91eeba1f2cfbe569a0717876f02025b22bf9 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 19 Jun 2007 13:18:17 +0000 Subject: [PATCH] fix ITS#5005 --- servers/slapd/ldapsync.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 == ',' ) { -- 2.39.5