Bug 76718

Summary: rpm w/custom queryformat segfaults
Product: [Retired] Red Hat Linux Reporter: Preston Brown <pbrown>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-25 14:16:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Preston Brown 2002-10-25 13:56:32 UTC
Description of Problem:

rpm -qa --queryformat "%-70{FILENAMES}\t%{FILEMD5S}\n"

produces a segfault.

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

4.1-1.06

How Reproducible:

always.

Jeff says may be related to #16617.

Comment 1 Jeff Johnson 2002-10-25 13:58:54 UTC
Reproduced, fix shortly.

Comment 2 Jeff Johnson 2002-10-25 14:16:18 UTC
Segfault is on /dev/initctl, which doesn't have MD5 sum.


Comment 3 Jeff Johnson 2002-10-25 14:44:20 UTC
AFAICT /dev/initctl (or other pipe) is the
only problem, fix is

Index: rpmdb/header.c
===================================================================
RCS file: /cvs/devel/rpm/rpmdb/header.c,v
retrieving revision 1.27
diff -u -r1.27 header.c
--- rpmdb/header.c      17 Sep 2002 15:21:04 -0000      1.27
+++ rpmdb/header.c      25 Oct 2002 14:42:10 -0000
@@ -2825,6 +2825,7 @@
     }
     
     /*@-branchstate@*/
+    if (data)
     switch (type) {
     case RPM_STRING_ARRAY_TYPE:
        strarray = (const char **)data;

in rpm-4.2.