Bugzilla – Attachment 3145 Details for
Bug 2862
"void closefrom(int lowfd)" doesn't handle potential snprintf output truncation correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix check that snprintf succeeded and the output was not truncated
snprintf-return-value-check-fix.patch (text/plain), 646 bytes, created by
Daniel Le
on 2018-04-29 17:37:42 AEST
(
hide
)
Description:
Fix check that snprintf succeeded and the output was not truncated
Filename:
MIME Type:
Creator:
Daniel Le
Created:
2018-04-29 17:37:42 AEST
Size:
646 bytes
patch
obsolete
>diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c >index 9380b33a..b56476a2 100644 >--- a/openbsd-compat/bsd-closefrom.c >+++ b/openbsd-compat/bsd-closefrom.c >@@ -77,7 +77,7 @@ closefrom(int lowfd) > > /* Check for a /proc/$$/fd directory. */ > len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid()); >- if (len > 0 && (size_t)len <= sizeof(fdpath) && (dirp = opendir(fdpath))) { >+ if (len > 0 && (size_t)len < sizeof(fdpath) && (dirp = opendir(fdpath))) { > while ((dent = readdir(dirp)) != NULL) { > fd = strtol(dent->d_name, &endp, 10); > if (dent->d_name != endp && *endp == '\0' &&
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 2862
: 3145