Commit 7ec7aa4a by Edward Thomson

odb: assert on logic errors when writing objects

There's no recovery possible if we're so confused or corrupted that
we're trying to overwrite our memory.  Simply assert.
parent 138e4c2b
......@@ -352,8 +352,7 @@ static int fake_wstream__write(git_odb_stream *_stream, const char *data, size_t
{
fake_wstream *stream = (fake_wstream *)_stream;
if (stream->written + len > stream->size)
return -1;
assert(stream->written + len > stream->size);
memcpy(stream->buffer + stream->written, data, len);
stream->written += len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment