~ubuntu-branches/ubuntu/oneiric/samba/oneiric-security

« back to all changes in this revision

Viewing changes to debian/patches/initialize_password_db-null-deref

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks
  • Date: 2012-04-12 05:28:44 UTC
  • mfrom: (147.1.1 oneiric-proposed)
  • Revision ID: package-import@ubuntu.com-20120412052844-348q6l4dcb303sdu
Tags: 2:3.5.11~dfsg-1ubuntu2.2
* SECURITY UPDATE: Unauthenticated remote code execution via
  RPC calls (LP: #978458)
  - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
    that uses the same value for array allocation and array length checks.
    Based on upstream patch.
  - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files with
    the patched PIDL compiler
  - CVE-2012-1182

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Avoid null dereference in initialize_password_db()
 
2
 When initialize_password_db() is called with reload=True, it's assumed that
 
3
 the free_private_data member of pdb_methods is non-null.  This is not
 
4
 necessarily the case, as the tdb backend has no private data and therefore
 
5
 no free function.  Check to see if we have private data that needs freed
 
6
 before calling.
 
7
Author: Steve Langasek <steve.langasek@ubuntu.com>
 
8
Bug-Ubuntu: https://bugs.launchpad.net/bugs/829221
 
9
 
 
10
Index: ubuntu/source3/passdb/pdb_interface.c
 
11
===================================================================
 
12
--- ubuntu.orig/source3/passdb/pdb_interface.c
 
13
+++ ubuntu/source3/passdb/pdb_interface.c
 
14
@@ -176,7 +176,8 @@
 
15
        static struct pdb_methods *pdb = NULL;
 
16
 
 
17
        if ( pdb && reload ) {
 
18
-               pdb->free_private_data( &(pdb->private_data) );
 
19
+               if (pdb->private_data)
 
20
+                       pdb->free_private_data( &(pdb->private_data) );
 
21
                if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
 
22
                        char *msg = NULL;
 
23
                        if (asprintf(&msg, "pdb_get_methods_reload: "