Jan Engelhardt aca19e063b 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 <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2511
Closes #2010
2014-07-22 09:55:37 -07:00
..
2014-05-30 12:01:57 -07:00
2013-11-05 12:23:11 -08:00
2013-12-16 09:15:57 -08:00
2013-09-04 15:49:00 -07:00
2013-09-04 15:49:00 -07:00
2013-12-18 16:46:35 -08:00