Bug 984430

Summary: libopts crashes on range error
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: autogenAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: green
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: autogen-5.18-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-08 11:36:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Lichvar 2013-07-15 08:32:17 UTC
Description of problem:
When a numeric autoopts option with specified minimum/maximum is used with a wrong value, the optionShowRange function crashes.

Version-Release number of selected component (if applicable):
autogen-libopts-5.12-5.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
1. install ntp
2. run ntp-keygen -m 1

Actual results:
crash

Expected results:
ntp-keygen error:  modulus option value 1 is out of range.
It must be in the range:
        256 to 2048

Additional info:
It seems to be fixed in newer autogen releases. The relevant patch is:

--- autoopts/usage-txt.h.optsrange     2011-05-16 06:14:36.000000000 +0200
+++ autoopts/usage-txt.h       2013-07-12 18:15:36.122764517 +0200
@@ -331,7 +331,7 @@ static char const usage_txt[4435] =
     "%sIt must lie in one of the ranges:\n\0"
     "%sIt must be in the range:\n\0"
     ", or\n\0"
-    "%s error:  %s option value ``%s'' is out of range.\n\0"
+    "%s error:  %s option value %ld is out of range.\n\0"
     "%s%ld exactly\0"
     "%sis scalable with a suffix: k/K/m/M/g/G/t/T\n\0"
     "%sless than or equal to %ld\0"

Comment 1 Fedora Admin XMLRPC Client 2013-08-07 16:16:35 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.