mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-12 15:10:31 +08:00
Warning cleanup: signed meets unsigned. (Adds variable dosearch():outlen.)
This commit is contained in:
parent
9a542f526d
commit
0d7ee548e1
@ -1146,14 +1146,15 @@ static int dosearch(
|
||||
int cancel_msgid = -1;
|
||||
|
||||
if( filtpatt != NULL ) {
|
||||
size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1;
|
||||
size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1, outlen;
|
||||
filter = malloc( max_fsize );
|
||||
if( filter == NULL ) {
|
||||
perror( "malloc" );
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if( snprintf( filter, max_fsize, filtpatt, value ) >= max_fsize ) {
|
||||
outlen = snprintf( filter, max_fsize, filtpatt, value );
|
||||
if( outlen >= max_fsize ) {
|
||||
fprintf( stderr, "Bad filter pattern: \"%s\"\n", filtpatt );
|
||||
free( filter );
|
||||
return EXIT_FAILURE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user