RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/python/ rpmts-py.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Thu 25 Oct 2007 - 17:06:39 CEST
Message-Id: <20071025150639.D3C7F34845B@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   25-Oct-2007 17:06:39
  Branch: HEAD                             Handle: 2007102516063900

  Modified files:
    rpm                     CHANGES
    rpm/python              rpmts-py.c

  Log:
    - don't modify strings exposed by method wrappers (#349091).

  Summary:
    Revision    Changes     Path
    1.1755      +1  -0      rpm/CHANGES
    1.75        +5  -2      rpm/python/rpmts-py.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1754 -r1.1755 CHANGES
  --- rpm/CHANGES	22 Oct 2007 02:48:40 -0000	1.1754
  +++ rpm/CHANGES	25 Oct 2007 15:06:39 -0000	1.1755
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - jbj: don't modify strings exposed by method wrappers (#349091).
       - jbj: drill headerAddExtension everywhere.
       - jbj: header.c: insturment headerGet{Entry,Extension} switch, debug goop.
       - jbj: rpmchecksig.c: wrap headerAddEntry. headerAddOrAppend next ...
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/python/rpmts-py.c
  ============================================================================
  $ cvs diff -u -r1.74 -r1.75 rpmts-py.c
  --- rpm/python/rpmts-py.c	21 Oct 2007 23:22:56 -0000	1.74
  +++ rpm/python/rpmts-py.c	25 Oct 2007 15:06:39 -0000	1.75
  @@ -549,6 +549,7 @@
   #else
   	    char * byName, * byVersion, * byRelease, *byArch;
   	    char * needsName, * needsOP, * needsVersion;
  +	    char * a, * b;
   	    int needsFlags, sense;
   	    fnpyKey key;
   
  @@ -558,7 +559,7 @@
   	    if (rpmProblemGetType(p) == RPMPROB_BADRELOCATE)
   		continue;
   
  -	    byName = rpmProblemGetPkgNEVR(p);
  +	    a = byName = xstrdup(rpmProblemGetPkgNEVR(p));
   	    if ((byArch= strrchr(byName, '.')) != NULL)
   		*byArch++ = '\0';
   	    if ((byRelease = strrchr(byName, '-')) != NULL)
  @@ -568,7 +569,7 @@
   
   	    key = rpmProblemKey(p);
   
  -	    needsName = rpmProblemGetAltNEVR(p);
  +	    b = needsName = xstrdup(rpmProblemGetAltNEVR(p));
   	    if (needsName[1] == ' ') {
   		sense = (needsName[0] == 'C')
   			? RPMDEP_SENSE_CONFLICTS : RPMDEP_SENSE_REQUIRES;
  @@ -591,6 +592,8 @@
   			       needsName, needsVersion, needsFlags,
   			       (key != NULL ? key : Py_None),
   			       sense);
  +	    a = _free(a);
  +	    b = _free(b);
   #endif
   	    PyList_Append(list, (PyObject *) cf);
   	    Py_DECREF(cf);
  @@ .
Received on Thu Oct 25 17:06:39 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.