Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix array out of bounds read. #4514

Merged
merged 112 commits into from
Aug 20, 2024
Merged

Fix array out of bounds read. #4514

merged 112 commits into from
Aug 20, 2024

Conversation

Mictronics
Copy link
Contributor

Causes lately a warning:
src/modules/AdminModule.cpp:355:18: warning: iteration 4 invokes undefined behavior [-Waggressive-loop-optimizations]

sizeof(r->get_module_config_response.payload_variant.remote_hardware.available_pins);will return a value of 80.
meshtastic_RemoteHardwarePin available_pins[4]; = (4+15+1) * 4

Someone more familiar with this part of code please check if available_pins_countis what we want here.

Mictronics and others added 30 commits January 4, 2024 10:27
@Mictronics
Copy link
Contributor Author

Got this error one time only on first reboot after flashing the fix.

ERROR | ??:??:?? 18 [Router] Can't decode protobuf reason='invalid wire_type', pb_msgdesc 0x10080c5c
ERROR | ??:??:?? 18 [Router] Error decoding protobuf module!
ERROR | ??:??:?? 18 [Router] Can't decode protobuf reason='invalid wire_type', pb_msgdesc 0x10080c5c
ERROR | ??:??:?? 18 [Router] Error decoding protobuf module!

Following reboots are all clean.

@thebentern
Copy link
Contributor

Good find.

@Mictronics Mictronics marked this pull request as ready for review August 20, 2024 18:19
@thebentern thebentern merged commit 6ee3004 into meshtastic:master Aug 20, 2024
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants