Fix crasher if paged results size is not specified

This commit is contained in:
Luke Howard 2004-02-27 09:32:16 +00:00
parent bd8712ad36
commit 9cc32ac874

View File

@ -303,11 +303,15 @@ handle_private_option( int i )
exit( EXIT_FAILURE );
}
if( cvalue != NULL ) {
num = sscanf( cvalue, "%d", &tmp );
if ( num != 1 ) {
fprintf( stderr, _("Invalid value for PagedResultsControl, %s.\n"), cvalue);
exit( EXIT_FAILURE );
}
} else {
fprintf( stderr, _("Invalid value for PagedResultsControl.\n"), cvalue);
exit( EXIT_FAILURE );
}
pageSize = (ber_int_t) tmp;
pagedResults = 1 + crit;