Closed xuezhulian closed 4 months ago
@GLinnik21 writer->buffer is a variable allocated on the stack, so it causes a stack overflow.
char writeBuffer[1024];
Let’s add some unit tests. If it’s too complex without mocks or dependency injection, we can merge it as is.
Sorry, writing unit tests is quite challenging for me.😞
When the disk space is insufficient, the ksfu_flushBufferedWriter method will return false, and the value of writer->position will not be set to 0. Continuing to write values to writer->buffer at this point will result in a stack overflow.