X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fvlvctrl.c;h=25241165e849e47a17b274ae4ca95d8f9eeeee6c;hb=cdbbed6c3b6a4f0b69fab6e37c3a098ca5d12620;hp=63adab1772a381e8dff7b1cb6f9a00bede6cd398;hpb=0e2af54a3ffdeebe3901370683be56fcc53023b0;p=openldap diff --git a/libraries/libldap/vlvctrl.c b/libraries/libldap/vlvctrl.c index 63adab1772..25241165e8 100644 --- a/libraries/libldap/vlvctrl.c +++ b/libraries/libldap/vlvctrl.c @@ -1,10 +1,18 @@ -/* - * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 1998-2005 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . */ -/* Adapted for inclusion into OpenLDAP by Kurt D. Zeilenga */ -/*--- - * Copyright (C) 1999, 2000 Novell, Inc. All Rights Reserved. +/* Portions Copyright (C) 1999, 2000 Novell, Inc. All Rights Reserved. * * THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND * TREATIES. USE, MODIFICATION, AND REDISTRIBUTION OF THIS WORK IS SUBJECT @@ -14,7 +22,14 @@ * OF THIS WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP * PUBLIC LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY. - *---*/ + *--- + * Note: A verbatim copy of version 2.0.1 of the OpenLDAP Public License + * can be found in the file "build/LICENSE-2.0.1" in this distribution + * of OpenLDAP Software. + */ +/* Portions Copyright (C) The Internet Society (1997) + * ASN.1 fragments are from RFC 2251; see RFC for full legal notices. + */ #include "portable.h" @@ -79,10 +94,10 @@ ldap_create_vlv_control( LDAP *ld, ber_tag_t tag; BerElement *ber; - if ( (ld==NULL) || (vlvinfop==NULL) || (ctrlp == NULL) ) { - ld->ld_errno = LDAP_PARAM_ERROR; - return(ld->ld_errno); - } + assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); + assert( vlvinfop != NULL ); + assert( ctrlp != NULL ); if ((ber = ldap_alloc_ber_with_options(ld)) == NULL) { ld->ld_errno = LDAP_NO_MEMORY; @@ -203,15 +218,13 @@ ldap_parse_vlv_control( ber_tag_t tag, berTag; ber_len_t berLen; + assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); + if (contextp) { *contextp = NULL; /* Make sure we return a NULL if error occurs. */ } - if (ld == NULL) { - ld->ld_errno = LDAP_PARAM_ERROR; - return(ld->ld_errno); - } - if (ctrls == NULL) { ld->ld_errno = LDAP_CONTROL_NOT_FOUND; return(ld->ld_errno);