FreeBSD Bugzilla – Attachment 22253 Details for
Bug 38671
Add a check for MAXPATHLEN to cp(1).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1017 bytes, created by
Giorgos Keramidas
on 2002-05-29 00:00:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Giorgos Keramidas
Created:
2002-05-29 00:00:09 UTC
Size:
1017 bytes
patch
obsolete
>Index: cp.c >=================================================================== >RCS file: /home/ncvs/src/bin/cp/cp.c,v >retrieving revision 1.35 >diff -u -r1.35 cp.c >--- cp.c 17 May 2002 12:24:19 -0000 1.35 >+++ cp.c 28 May 2002 21:25:22 -0000 >@@ -172,6 +172,8 @@ > > /* Save the target base in "to". */ > target = argv[--argc]; >+ if (strlen(target) > MAXPATHLEN) >+ errx(1, "%s: name too long", target); > if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path)) > errx(1, "%s: name too long", target); > to.p_end = to.p_path + strlen(to.p_path); >@@ -290,6 +292,14 @@ > * source name to the target name. > */ > if (type != FILE_TO_FILE) { >+ if ((curr->fts_namelen + >+ to.target_end - to.p_path + 1) > MAXPATHLEN) { >+ warnx("%s/%s: name too long (not copied)", >+ to.p_path, curr->fts_name); >+ rval = 1; >+ continue; >+ } >+ > /* > * Need to remember the roots of traversals to create > * correct pathnames. If there's a directory being >%%%
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38671
: 22253