RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   09-May-2009 17:51:08
  Branch: HEAD                             Handle: 2009050915510701

  Modified files:
    rpm                     CHANGES
    rpm/rpmio               mire.c
    rpm/tools               rpmgrep.c

  Log:
    - grep: fix: don't segfault if no usage mutex or pool attached.

  Summary:
    Revision    Changes     Path
    1.2975      +4  -3      rpm/CHANGES
    1.51        +7  -3      rpm/rpmio/mire.c
    2.3         +1  -0      rpm/tools/rpmgrep.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2974 -r1.2975 CHANGES
  --- rpm/CHANGES       8 May 2009 14:28:41 -0000       1.2974
  +++ rpm/CHANGES       9 May 2009 15:51:07 -0000       1.2975
  @@ -1,9 +1,10 @@
   
   5.2b1 -> 5.3a1
  -     - proyvind: remove %distepoch from %provideversion as it will break
  +    - jbj: grep: fix: don't segfault if no usage mutex or pool attached.
  +    - proyvind: remove %distepoch from %provideversion as it will break
        compatibility with rpm <= 4.5.
  -     - proyvind: rpm4compat: add a wrapper function for headerFormat().
  -     - rse: align semantics of Lua function rpm.hostname() with the C API 
function buildHost()
  +    - proyvind: rpm4compat: add a wrapper function for headerFormat().
  +    - rse: align semantics of Lua function rpm.hostname() with the C API 
function buildHost()
   
   =============================================================================
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/mire.c
  ============================================================================
  $ cvs diff -u -r1.50 -r1.51 mire.c
  --- rpm/rpmio/mire.c  30 Mar 2009 14:27:02 -0000      1.50
  +++ rpm/rpmio/mire.c  9 May 2009 15:51:07 -0000       1.51
  @@ -115,9 +115,13 @@
        int i;
        for (i = 0; i < nmire; i++)
            (void) mireClean(mire + i);
  -     /* XXX only the 1st element in the array has a usage mutex. */
  -     mire = xrealloc(mire, sizeof(*mire));
  -     mire = (miRE)rpmioFreePoolItem((rpmioItem)mire, __FUNCTION__, __FILE__, 
__LINE__);
  +     /* XXX rpmgrep doesn't use mire pools yet. retrofit a fix. */
  +     if (mire->_item.use != NULL && mire->_item.pool != NULL) {
  +         /* XXX only the 1st element in the array has a usage mutex. */
  +         mire = xrealloc(mire, sizeof(*mire));
  +         mire = (miRE)rpmioFreePoolItem((rpmioItem)mire, __FUNCTION__, 
__FILE__, __LINE__);
  +     } else
  +         mire = _free(mire);
       }
       return NULL;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tools/rpmgrep.c
  ============================================================================
  $ cvs diff -u -r2.2 -r2.3 rpmgrep.c
  --- rpm/tools/rpmgrep.c       11 Apr 2009 14:47:13 -0000      2.2
  +++ rpm/tools/rpmgrep.c       9 May 2009 15:51:08 -0000       2.3
  @@ -1486,6 +1486,7 @@
       }
   
       /* Get memory to store the pattern and hints lists. */
  +    /* XXX FIXME: rpmmireNew needs to be used here. */
       pattern_list = xcalloc(MAX_PATTERN_COUNT, sizeof(*pattern_list));
   
       /*
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to