Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1279

Summary: Core from xargs due to out of range string copying
Product: [Retired] Red Hat Linux Reporter: Mark Cooke <mpc>
Component: findutilsAssignee: Preston Brown <pbrown>
Severity: medium Docs Contact:
Priority: high    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-03-29 22:05:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mark Cooke 1999-02-22 16:21:15 UTC
Using substitution for xargs scripting can cause an
out of bounds string copy, which in turn causes a core.


echo 123 | xargs -i touch --reference={}.body {}.shtml

file core
core: ELF 32-bit LSB core file of 'xargs' (signal 11), Intel
80386, version 1


A patch to the do_insert function.

--- findutils-4.1/xargs/xargs.c.orig    Mon Feb 22 16:18:15
+++ findutils-4.1/xargs/xargs.c Mon Feb 22 16:18:48 1999
@@ -625,4 +625,5 @@
       p += len;
       arg += len;
+      arglen -= len;

       if (s)
@@ -633,4 +634,5 @@
          strcpy (p, linebuf);
          arg += rplen;
+          arglen -= rplen;
          p += lblen;


Mark Cooke

Comment 1 Preston Brown 1999-03-29 22:04:59 UTC
fixed in findutils-4.1-31 and later, available in the RawHide tree
(and 6.0, if you don't mind waiting).