9367202dbcaa3ea406a1f1bc134f196a8d466fd3
Fixed two critical bugs in the TinyDFS client code: 1. Added bounds checking in alloc_operation() to prevent buffer overflow when searching for a free operation slot. The while loop could go past the end of the operations array, causing undefined behavior. 2. Fixed all tinydfs_submit_* functions to return the operation index (opidx) instead of 0 on success. This was causing all operations to be tracked with index 0, leading to type mismatches between operation types and result types, which triggered the assertion: "Assertion `pending.type == PENDING_OPERATION_DELETE' failed" The test now runs successfully past the original assertion point.
Languages
C
98.4%
Shell
1%
Zig
0.4%
Batchfile
0.2%