FreeBSD Bugzilla – Attachment 600 Details for
Bug 2580
security hole in glob.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.76 KB, created by
Julian Assange
on 1997-01-25 15:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Julian Assange
Created:
1997-01-25 15:10:00 UTC
Size:
1.76 KB
patch
obsolete
>--- src/lib/libc/gen/glob.c Thu Oct 31 15:32:27 1996 >+++ src/lib/libc/gen/glob.c.new Sun Jan 26 01:53:07 1997 >@@ -142,7 +142,7 @@ > static int glob2 __P((Char *, Char *, Char *, glob_t *)); > static int glob3 __P((Char *, Char *, Char *, Char *, glob_t *)); > static int globextend __P((const Char *, glob_t *)); >-static const Char * globtilde __P((const Char *, Char *, glob_t *)); >+static const Char * globtilde __P((const Char *, Char *, int, glob_t *)); > static int globexp1 __P((const Char *, glob_t *)); > static int globexp2 __P((const Char *, const Char *, glob_t *, int *)); > static int match __P((Char *, Char *, Char *)); >@@ -332,21 +332,23 @@ > * expand tilde from the passwd file. > */ > static const Char * >-globtilde(pattern, patbuf, pglob) >+globtilde(pattern, patbuf, len, pglob) > const Char *pattern; > Char *patbuf; >+ int len; > glob_t *pglob; > { > struct passwd *pwd; > char *h; > const Char *p; > Char *b; >+ int l; > > if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) > return pattern; > > /* Copy up to the end of the string or / */ >- for (p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH; >+ for (l = len, p = pattern + 1, h = (char *) patbuf; *p && *p != SLASH && l-- >0; > *h++ = *p++) > continue; > >@@ -375,11 +377,11 @@ > } > > /* Copy the home directory */ >- for (b = patbuf; *h; *b++ = *h++) >+ for (l = len, b = patbuf; *h && l-- >0; *b++ = *h++) > continue; > > /* Append the rest of the pattern */ >- while ((*b++ = *p++) != EOS) >+ while (l-- >0 && (*b++ = *p++) != EOS) > continue; > > return patbuf; >@@ -402,7 +404,7 @@ > int c, err, oldpathc; > Char *bufnext, patbuf[MAXPATHLEN+1]; > >- qpatnext = globtilde(pattern, patbuf, pglob); >+ qpatnext = globtilde(pattern, patbuf, sizeof patbuf, pglob); > oldpathc = pglob->gl_pathc; > bufnext = patbuf;
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 2580
: 600