]> git.sur5r.net Git - openldap/commitdiff
fix types; further check parameters
authorPierangelo Masarati <ando@openldap.org>
Sun, 8 Jan 2006 22:45:35 +0000 (22:45 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 8 Jan 2006 22:45:35 +0000 (22:45 +0000)
libraries/libldap/pagectrl.c

index 67f648c37b6c24d48dd187522ba7fe3271d12014..d470eef167b13c85f2488f6ad11ba520ffa3fe5e 100644 (file)
@@ -85,7 +85,7 @@ ldap_create_page_control_value(
        ber_tag_t       tag;
        struct berval   null_cookie = { 0, NULL };
 
-       if ( ld == NULL || value == NULL ) {
+       if ( ld == NULL || value == NULL || pagesize > LDAP_MAXINT ) {
                ld->ld_errno = LDAP_PARAM_ERROR;
                return ld->ld_errno;
        }
@@ -105,7 +105,7 @@ ldap_create_page_control_value(
                return ld->ld_errno;
        }
 
-       tag = ber_printf( ber, "{iO}", pagesize, cookie );
+       tag = ber_printf( ber, "{iO}", (ber_int_t)pagesize, cookie );
        if ( tag == LBER_ERROR ) {
                goto error_return;
        }