Skip to content

In getProtocolVersion(), PayloadCfg out of bounds #217

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

Closed
xuyaozhong opened this issue May 16, 2024 · 1 comment
Closed

In getProtocolVersion(), PayloadCfg out of bounds #217

xuyaozhong opened this issue May 16, 2024 · 1 comment

Comments

@xuyaozhong
Copy link

Default sizeof payloadCfg is 256.
Array 'payloadCfg[256]' accessed at index 270, which is out of bounds.
Please fix this issue.
Thank you

`diff --git a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
index 6d68956..f2e51fc 100644
--- a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
+++ b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
@@ -7725,7 +7725,7 @@ bool SFE_UBLOX_GNSS::getProtocolVersion(uint16_t maxWait)
// }

// We will step through the payload looking at each extension field of 30 bytes

  • for (uint8_t extensionNumber = 0; extensionNumber < 10; extensionNumber++)
  • for (uint8_t extensionNumber = 0; extensionNumber < (packetCfgPayloadSize / 30); extensionNumber++)
    {
    // Now we need to find "PROTVER=18.00" in the incoming byte stream
    if ((payloadCfg[(30 * extensionNumber) + 0] == 'P') && (payloadCfg[(30 * extensionNumber) + 6] == 'R'))
    `
PaulZC added a commit that referenced this issue May 16, 2024
@PaulZC
Copy link
Collaborator

PaulZC commented May 16, 2024

Hi @xuyaozhong ,

Thank you for reporting this issue.

Which u-blox module are you using?

I can not replicate this issue with either the NEO-F10N or MAX-M10S. But I have corrected it in v2.2.26. Please test v2.2.26 with your module.

Best wishes,
Paul

@PaulZC PaulZC closed this as completed May 16, 2024
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

No branches or pull requests

2 participants