Git Product home page Git Product logo

Comments (7)

coelckers avatar coelckers commented on August 23, 2024

Where does that 5 come from?

from zmusic.

alexey-lysiuk avatar alexey-lysiuk commented on August 23, 2024

https://github.com/coelckers/ZMusic/blob/a192e660493b9efaa5268fd1598f7cbe1465238b/source/mididevices/music_wavewriter_mididevice.cpp#L155
Seems to be a typo.

from zmusic.

Cacodemon345 avatar Cacodemon345 commented on August 23, 2024

This seems to be a buffer overflow bug too. Needs quick fixing.

from zmusic.

alexey-lysiuk avatar alexey-lysiuk commented on August 23, 2024

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.

from zmusic.

alexey-lysiuk avatar alexey-lysiuk commented on August 23, 2024

Does it compile with ba9e9da?

from zmusic.

Cacodemon345 avatar Cacodemon345 commented on August 23, 2024

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).

from zmusic.

alexey-lysiuk avatar alexey-lysiuk commented on August 23, 2024

Done.

from zmusic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.