avsa242 / sdfat-spin

FAT-fs on SD implementation for the P8X32A/Propeller, P2X8C4M64P/Propeller 2
Other
0 stars 0 forks source link

fwrite(): length isn't verified #26

Closed avsa242 closed 6 months ago

avsa242 commented 6 months ago

It shouldn't waste time doing anything if it was called with write length 0 (without having reviewed the code in detail - maybe doing so could even cause problems).

avsa242 commented 6 months ago

After looking at it closer, This isn't strictly true. The repeat loop is only entered if the number of bytes (which is initialized to the length) is > 0. The only other code executed before that are other initial checks.