FreeBSD Bugzilla – Attachment 181719 Details for
Bug 218592
[patch] fsck_ffs(8): incorrect bounds check in preen mode when softdep is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Prevent inosused from wrapping
pass1.c.diff (text/plain), 769 bytes, created by
Todd C. Miller
on 2017-04-12 15:20:43 UTC
(
hide
)
Description:
Prevent inosused from wrapping
Filename:
MIME Type:
Creator:
Todd C. Miller
Created:
2017-04-12 15:20:43 UTC
Size:
769 bytes
patch
obsolete
>Index: pass1.c >=================================================================== >--- pass1.c (revision 316723) >+++ pass1.c (working copy) >@@ -133,9 +133,14 @@ > */ > if ((preen || inoopt) && usedsoftdep && !rebuildcg) { > cp = &cg_inosused(cgp)[(inosused - 1) / CHAR_BIT]; >- for ( ; inosused > 0; inosused -= CHAR_BIT, cp--) { >- if (*cp == 0) >+ for ( ; inosused != 0; cp--) { >+ if (*cp == 0) { >+ if (inosused > CHAR_BIT) >+ inosused -= CHAR_BIT; >+ else >+ inosused = 0; > continue; >+ } > for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) { > if (*cp & i) > break; >@@ -143,8 +148,6 @@ > } > break; > } >- if (inosused < 0) >- inosused = 0; > } > /* > * Allocate inoinfo structures for the allocated inodes.
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 218592
: 181719