• Show log

    Commit

  • Hash : a52b4c51
    Author : Patrick Steinhardt
    Date : 2018-03-23T09:59:46

    odb: fix writing to fake write streams
    
    In commit 7ec7aa4a7 (odb: assert on logic errors when writing objects,
    2018-02-01), the check for whether we are trying to overflowing the fake
    stream buffer was changed from returning an error to raising an assert.
    The conversion forgot though that the logic around `assert`s are
    basically inverted. Previously, if the statement
    
        stream->written + len > steram->size
    
    evaluated to true, we would return a `-1`. Now we are asserting that
    this statement is true, and in case it is not we will raise an error. So
    the conversion to the `assert` in fact changed the behaviour to the
    complete opposite intention.
    
    Fix the assert by inverting its condition again and add a regression
    test.