bareos: master e603d304

Author Committer Branch Timestamp Parent
mvwieringen adm mvwieringen adm master 2013-05-04 21:09 master e853f436 Pending
Affected Issues  0000096: btape crashes using multiple tape test when tape was written by a fill test before - segmentation violation Floating-point excep
Changeset Fix floating point exception.

dev->max_file_size = 2 * num_recs * dev->max_block_size;

max_block_size can be 0

which gives a max_file_size which is 0

when you then calculate

write_eof = dev->max_file_size / REC_SIZE; /*compute when we add EOF*/

then write_eof = 0 and when you then do

if ((block->BlockNumber % write_eof) == 0) {

You get a nice Floating Point Execption.

We now set max_file_size to something more appropriate and assert on
write_eof being bigger then 0 so we never do a divide by zero again.

Fixes 0000096: btape crashes using multiple tape test when tape was written by a fill test before.
mod - src/stored/btape.c Diff File