Git Product home page Git Product logo

Comments (3)

xgroleau avatar xgroleau commented on September 26, 2024

After some testing I can confirm that on pure C code, disabling vlen doesn't prevent variable length received on the server. So this is not a bug, simply a misunderstanding of what vlen does. If the client writes 0 bytes, the received packet is 0 on the server.

Variable length only changes the length of the client when he reads or is notified by the server, not when the server receives data.

I don't know what would be the best way to handle this, but padding with zeroes (while considering endianness) could be an option.

from nrf-softdevice.

chrysn avatar chrysn commented on September 26, 2024

Attempting to clarify to any other new user of this crate, because this took me a while running into the issue and finding this:

AIU, the softdevice should already filter out attempts to write outside of the bounds established by this crate. Some interpretation difference between the softdevice and this crate causes issues. At least from this crate's point of view, the many unwrap! calls in gatt_traits.rs are justified, just something about when the size guards should kick in is unclear.

(This doesn't change anything about this being an issue, but the crate authors are not lightly spreading unwraps in paths that are user controlled).

from nrf-softdevice.

alexmoon avatar alexmoon commented on September 26, 2024

I've created a quick fix at #139. Writes with a bad length will be ignored rather than panicking. If more sophisticated handling is needed you can implement the service by hand. Let me know if the PR resolves the issue for you.

from nrf-softdevice.

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.