diff options
author | Jan Engelhardt <[email protected]> | 2014-07-18 20:00:27 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-07-22 09:55:37 -0700 |
commit | aca19e063b5126aab797f5739faaf3ddc82bd587 (patch) | |
tree | 3baaf2f237d1978a106bb29cc17759c37fc58787 /config/kernel-bdi-setup-and-register.m4 | |
parent | 7a8f0e80eae9053ebe6a3c5ce5f3360e8df8de2f (diff) |
Do not attempt access beyond the declared end of the dn_blkptr array
This loop in dmu_objset_write_ready():
for (i = 0; i < dnp->dn_nblkptr; i++)
bp->blk_fill += dnp->dn_blkptr[i].blk_fill;
invokes _undefined behavior_ for the (common) case of dn_nblkptr=3,
therefore, the compiler is free to do whatever it wants (such as
optimizing it away, or otherwise messing up your expections).
The fix is to be honest about the array size.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2511
Closes #2010
Diffstat (limited to 'config/kernel-bdi-setup-and-register.m4')
0 files changed, 0 insertions, 0 deletions