mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Fix crasher if paged results size is not specified
This commit is contained in:
parent
bd8712ad36
commit
9cc32ac874
@ -302,12 +302,16 @@ handle_private_option( int i )
|
||||
fprintf( stderr, _("PagedResultsControl previously specified\n") );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
num = sscanf( cvalue, "%d", &tmp );
|
||||
if ( num != 1 ) {
|
||||
fprintf( stderr, _("Invalid value for PagedResultsControl, %s.\n"), cvalue);
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user