apache / mynewt-nimble

Apache mynewt
https://mynewt.apache.org/
Apache License 2.0
680 stars 392 forks source link

nimble/host: Zero initialize buffer after allocation #1687

Open rahult-github opened 6 months ago

rahult-github commented 6 months ago

At many places , after getting buffer using os_memblock_get, buffer is not zero initiatlized. Added change to memset the same to 0.

rahult-github commented 6 months ago

@andrzej-kaczmarek , @sjanc , please take a look

sjanc commented 5 months ago

Hi,

Does this fix any use of uninitialized memory or is just a precaution?

As for style, please use sizeof(*foo) syntax

rahult-github commented 5 months ago

Hi,

Does this fix any use of uninitialized memory or is just a precaution?

As for style, please use sizeof(*foo) syntax

Currently , just precaution, since i didn't find any issue as such during my testing. But in many places in nimble, such memset is already existing, hence added at places where it is missing.

For style, sure, will change and re-push

rahult-github commented 3 months ago

Hello @sjanc , please take a look