FreeBSD Bugzilla – Attachment 215239 Details for
Bug 246983
sbput(3) writes out the values of pointers verbatim
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
in ffs_sbput(), clear the pointers for the duration of writing
gay.patch (text/plain), 989 bytes, created by
goatshit54108
on 2020-06-05 00:45:02 UTC
(
hide
)
Description:
in ffs_sbput(), clear the pointers for the duration of writing
Filename:
MIME Type:
Creator:
goatshit54108
Created:
2020-06-05 00:45:02 UTC
Size:
989 bytes
patch
obsolete
>--- sys/ufs/ffs/ffs_subr.c 2019-11-01 01:01:49.000000000 +0100 >+++ sys/ufs/ffs/ffs_subr.c >@@ -341,6 +341,10 @@ > { > int i, error, blks, size; > uint8_t *space; >+ u_int8_t *fs_contigdirs; >+ struct csum *fs_csp; >+ int32_t *fs_maxcluster; >+ u_int *fs_active; > > /* > * If there is summary information, write it first, so if there >@@ -362,9 +366,21 @@ > } > fs->fs_fmod = 0; > fs->fs_time = UFS_TIME; >- if ((error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize)) != 0) >- return (error); >- return (0); >+ /* Clear the pointers for the duration of writing. */ >+ fs_contigdirs = fs->fs_contigdirs; >+ fs_csp = fs->fs_csp; >+ fs_maxcluster = fs->fs_maxcluster; >+ fs_active = fs->fs_active; >+ fs->fs_contigdirs = NULL; >+ fs->fs_csp = NULL; >+ fs->fs_maxcluster = NULL; >+ fs->fs_active = NULL; >+ error = (*writefunc)(devfd, loc, fs, fs->fs_sbsize); >+ fs->fs_contigdirs = fs_contigdirs; >+ fs->fs_csp = fs_csp; >+ fs->fs_maxcluster = fs_maxcluster; >+ fs->fs_active = fs_active; >+ return (error); > } > > /*
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 246983
: 215239