FreeBSD Bugzilla – Attachment 7467 Details for
Bug 16186
[MFC] [PATCH] Insecure use of strncpy() and strcpy() in lpr(1)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.01 KB, created by
venglin
on 2000-01-18 19:10:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
venglin
Created:
2000-01-18 19:10:02 UTC
Size:
1.01 KB
patch
obsolete
>--- printjob.c.orig Tue Jan 18 19:34:50 2000 >+++ printjob.c Tue Jan 18 19:39:23 2000 >@@ -818,24 +818,30 @@ > i = 0; > while (*cp >= '0' && *cp <= '9') > i = i * 10 + (*cp++ - '0'); > fino = i; > } else if (line[0] == 'H') { >- strcpy(fromhost, line+1); >+ strncpy(fromhost, line+1, sizeof(fromhost) - 1); >+ fromhost[sizeof(fromhost)-1] = '\0'; > if (class[0] == '\0') >+ { > strncpy(class, line+1, sizeof(class) - 1); >+ class[sizeof(class)-1] = '\0'; >+ } > } else if (line[0] == 'P') { > strncpy(logname, line+1, sizeof(logname) - 1); >+ logname[sizeof(logname)-1] = '\0'; > if (pp->restricted) { /* restricted */ > if (getpwnam(logname) == NULL) { > sendmail(pp, line+1, NOACCT); > err = ERROR; > break; > } > } > } else if (line[0] == 'I') { > strncpy(indent+2, line+1, sizeof(indent) - 3); >+ indent[2+sizeof(indent)-3] = '\0'; > } else if (line[0] >= 'a' && line[0] <= 'z') { > strcpy(last, line); > while ((i = getline(cfp)) != 0) > if (strcmp(last, line)) > break;
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 16186
: 7467