Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145619675
D41023.id124624.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41023.id124624.diff
View Options
diff --git a/usr.bin/xargs/tests/regress.n2147483647.out b/usr.bin/xargs/tests/regress.n2147483647.out
new file mode 100644
--- /dev/null
+++ b/usr.bin/xargs/tests/regress.n2147483647.out
@@ -0,0 +1 @@
+quick brown fox jumped over the lazy dog
diff --git a/usr.bin/xargs/tests/regress.sh b/usr.bin/xargs/tests/regress.sh
--- a/usr.bin/xargs/tests/regress.sh
+++ b/usr.bin/xargs/tests/regress.sh
@@ -5,6 +5,7 @@
REGRESSION_START($1)
REGRESSION_TEST(`normal', `xargs echo The <${SRCDIR}/regress.in')
+REGRESSION_TEST(`n2147483647', `xargs -n2147483647 <${SRCDIR}/regress.in')
REGRESSION_TEST(`I', `xargs -I% echo The % % % %% % % <${SRCDIR}/regress.in')
REGRESSION_TEST(`J', `xargs -J% echo The % again. <${SRCDIR}/regress.in')
REGRESSION_TEST(`L', `xargs -L3 echo <${SRCDIR}/regress.in')
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -257,7 +257,7 @@
* the maximum arguments to be read from stdin and the trailing
* NULL.
*/
- linelen = 1 + argc + nargs + 1;
+ linelen = 1 + argc + (size_t)nargs + 1;
if ((av = bxp = malloc(linelen * sizeof(char *))) == NULL)
errx(1, "malloc failed");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 23, 6:42 AM (12 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28927430
Default Alt Text
D41023.id124624.diff (1 KB)
Attached To
Mode
D41023: xargs: Prevent overflow in linelen calculation if nargs is large.
Attached
Detach File
Event Timeline
Log In to Comment