Closed Cacodemon345 closed 3 years ago
Where does that 5 come from?
This seems to be a buffer overflow bug too. Needs quick fixing.
Not really. The given line will write four intended bytes and one junk byte to a file. It's impossible to alter stack or heap. The most severe effect would be a crash if the next byte after size
variable cannot be read.
Does it compile with ba9e9da?
Yep. But I am getting this warning:
/home/caco345/ZMusic/source/zmusic/zmusic.cpp:506:2: warning: deleting pointer to incomplete type '__sFILE' may cause undefined behavior [-Wdelete-incomplete]
delete f;
^ ~
/home/caco345/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdio.h:58:8: note: forward declaration of '__sFILE'
struct __sFILE;
^
1 warning generated.
The FILE
struct is an incomplete type when building for Android Nougat and later. delete f
should be changed to fclose(f)
.
This is the error I get when I build ZMusic with Android NDK.