Bug 435078 - The output of "strings -0 file" is in loop and "-n 0xA" cannot be correctly recognized
The output of "strings -0 file" is in loop and "-n 0xA" cannot be correctly r...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: binutils (Show other bugs)
5.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Jan Kratochvil
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-27 03:14 EST by chuli
Modified: 2010-10-22 18:49 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:57:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
correct the bug when using "-0" and use strtoul() in replace integer_arg() to fix "-n hexnumber" (2.32 KB, patch)
2008-02-27 03:14 EST, chuli
no flags Details | Diff
Upstream form of the Comment 1 patch. (3.65 KB, patch)
2008-04-16 09:36 EDT, Jan Kratochvil
no flags Details | Diff
Upstream patch reduced for a needless output change for RHEL. (3.10 KB, patch)
2008-04-16 09:41 EDT, Jan Kratochvil
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 5713 None None None Never

  None (edit)
Description chuli 2008-02-27 03:14:53 EST
Description of problem:
Use "strings -0 file", the output will be in loop.
And "strings -n 0xA file" will report error as "invalid number 0xA"

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

binutils-2.17.50.0.6-5.el5

How reproducible:
100%


Steps to Reproduce:
1.touch file contains some characters
2.execute "strings -0 file"
3.execute "strings -n 0xA file"
  
Actual results:
step2 is in loop and step3 will report "invalid number 0xA"

Expected results:
step2 will report "invalid number 0" and step3 will print the strings of which 
the length is more than 9 in file.

Additional info:
It seems the minumum length of "strings -n 0xB" is not 11.
Comment 1 chuli 2008-02-27 03:14:53 EST
Created attachment 296030 [details]
correct the bug when using "-0" and use strtoul() in replace integer_arg() to fix "-n hexnumber"
Comment 2 Jan Kratochvil 2008-04-16 09:36:37 EDT
Created attachment 302600 [details]
Upstream form of the Comment 1 patch.

Upstream commits:
  http://sourceware.org/ml/binutils-cvs/2008-02/msg00083.html
  http://sourceware.org/ml/binutils-cvs/2008-02/msg00036.html

2008-02-15  Chu Li  <chul@cn.fujitsu.com>
	    Nick Clifton  <nickc@redhat.com>

	PR binutils/5713
	* strings.c (integer_arg): Delete function.
	(string_min): Initialise to 4.
	(main): Use strtoul to parse integer arguments.
	Move check for an invalid string length to after all the arguments
	have been parsed.
	(usage): Use indentation to indicate that -<n> is a another form
	of the --bytes= command line option.

2008-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/5713
	* strings.c (main): Set string_min to 4 if it is <= 0.
Comment 3 Jan Kratochvil 2008-04-16 09:41:05 EDT
Created attachment 302601 [details]
Upstream patch reduced for a needless output change for RHEL.
Comment 4 RHEL Product and Program Management 2008-06-02 16:16:34 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 15 errata-xmlrpc 2009-01-20 16:57:25 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0198.html

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