~ubuntu-branches/ubuntu/hardy/openldap2.3/hardy-updates

« back to all changes in this revision

Viewing changes to servers/slapd/back-bdb/idl.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2008-07-31 16:06:53 UTC
  • mfrom: (16.1.3 hardy-proposed)
  • Revision ID: james.westby@ubuntu.com-20080731160653-np1dr19qfutmqb0v
Tags: 2.4.9-0ubuntu0.8.04.1
* SECURITY UPDATE: denial of service via broken BER decoding.
* Added debian/patches/security-ber-decoding.patch: upstream fixes.
* References
  CVE-2008-2952

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* idl.c - ldap id list handling routines */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/idl.c,v 1.124.2.5 2007/09/26 20:41:38 ando Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/back-bdb/idl.c,v 1.124.2.7 2008/02/11 23:26:45 kurt Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
 
 * Copyright 2000-2007 The OpenLDAP Foundation.
 
5
 * Copyright 2000-2008 The OpenLDAP Foundation.
6
6
 * All rights reserved.
7
7
 *
8
8
 * Redistribution and use in source and binary forms, with or without
715
715
 
716
716
        assert( id != NOID );
717
717
 
718
 
        if ( bdb->bi_idl_cache_size ) {
719
 
                bdb_idl_cache_del( bdb, db, key );
720
 
        }
721
 
 
722
718
        DBTzero( &data );
723
719
        data.size = sizeof( ID );
724
720
        data.ulen = data.size;
891
887
                cursor->c_close( cursor );
892
888
                return rc;
893
889
        }
 
890
        /* If key was added (didn't already exist) and using IDL cache,
 
891
         * update key in IDL cache.
 
892
         */
 
893
        if ( !rc && bdb->bi_idl_cache_max_size ) {
 
894
                bdb_idl_cache_add_id( bdb, db, key, id );
 
895
        }
894
896
        rc = cursor->c_close( cursor );
895
897
        if( rc != 0 ) {
896
898
                Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: "
923
925
        }
924
926
        assert( id != NOID );
925
927
 
926
 
        if ( bdb->bi_idl_cache_max_size ) {
 
928
        if ( bdb->bi_idl_cache_size ) {
927
929
                bdb_idl_cache_del( bdb, db, key );
928
930
        }
929
931