]> git.sur5r.net Git - openldap/commitdiff
fix ITS#5005
authorPierangelo Masarati <ando@openldap.org>
Tue, 19 Jun 2007 13:18:17 +0000 (13:18 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 19 Jun 2007 13:18:17 +0000 (13:18 +0000)
servers/slapd/ldapsync.c

index 5870635a699c1cdd73cd90348f654260acc2a44a..840a3c131de0c03b40eaab22e44445d1099893fa 100644 (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 == ',' ) {