Bug 31976

Summary: rpm-4.0 --queryformat segmentation fault
Product: [Retired] Red Hat Linux Reporter: Need Real Name <sakima>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.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: 2003-01-03 14:06:35 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 Need Real Name 2001-03-16 08:34:33 UTC
Searched the bugs database.  Didn't see bug reports that were obviously quite like this.

Looked for updates to RPM and didn't see any listed under Red Hat Linux 7.0

With RPM 4.0 in a non-updated, stock installation running on a consumer P100, the following command:

	rpm -qp "${package}" --queryformat '[%{DIRINDEXES}\t%{DIRNAMES}\n]\n'

causes the following error message to be printed:

	Segmentation fault (core dumped)

while this command does not:

	rpm -qp "${package}" --queryformat '[%{DIRNAMES}\t%{DIRINDEXES}\n]\n'

and neither does this:

	rpm -qp "${package}" --queryformat '[%{DIRINDEXES}\n]\n'

Comment 1 Jeff Johnson 2001-03-18 13:54:34 UTC
What's happening is that the '[' array iterator expects tags for identically
sized arrays,
that's not the case with DIRINDEXES (no. of files) and DIRNAMES (no of dirs).

The fix is going to be to detect different sized arrays and print an error.

Comment 2 Jeff Johnson 2003-01-03 14:06:35 UTC
Fixed in rpm-4.2-0.49