Bug 113661 - labelCompare segfaults if V or R is None
labelCompare segfaults if V or R is None
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2004-01-16 04:29 EST by Paul Nasrat
Modified: 2014-01-21 17:48 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-20 15:11:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Error handling for V/R == None in labelCompare (574 bytes, patch)
2004-01-16 04:50 EST, Paul Nasrat
no flags Details | Diff
This is the patch I'm putting into CVS (HEAD and rpm-4_3 branch) to fix the additional problem (1.44 KB, patch)
2004-02-20 15:08 EST, Elliot Lee
no flags Details | Diff

  None (edit)
Description Paul Nasrat 2004-01-16 04:29:32 EST
Description of problem:

Seth pointed this out to me, that if you parse a tuple with version
None (or release None) then you get a segfault.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Run following python fragment

import rpm
rpm.labelCompare(('1', None,'1'), ('1', '1', '1'))

Actual results:


Expected results:

Segfault shouldn't occur.

Additional info:

Tested on a few different rpm versions.

Discussion with Seth and Owen Stampflee, basically rpmvercmp is being
called with NULL.  Obviously same occurs using rpmlib/C directly.

I've added a check in header-py.c which will throw an exception, as I
think this should be handled by the caller rather than the library
function.  Can you inspect before commit (once bitten!)
Comment 1 Paul Nasrat 2004-01-16 04:50:26 EST
Created attachment 97050 [details]
Error handling for V/R == None in labelCompare
Comment 2 Jeff Johnson 2004-01-26 04:56:23 EST
Inspected, checked in. should be in rpm-4.3-0.9 when built.
Comment 3 Elliot Lee 2004-02-20 14:48:44 EST
This breaks labelCompare behaviour compared to previous rpm versions.
Comment 4 Elliot Lee 2004-02-20 15:08:56 EST
Created attachment 97884 [details]
This is the patch I'm putting into CVS (HEAD and rpm-4_3 branch) to fix the additional problem
Comment 5 Warren Togami 2004-02-21 17:02:41 EST
Note that the patch in comment #4 does not handle the case where Epoch
is undefined in both packages.  Elliot checked in the fix to CVS
immediately after.  See cvs.rpm.org for the newer fix.

Note You need to log in before you can comment on or make changes to this bug.