Skip to content

arch/arm: nrf91: bound modem version parsing#19328

Merged
jerpelea merged 1 commit into
apache:masterfrom
Old-Ding:codex/nrf91-bound-modem-version
Jul 6, 2026
Merged

arch/arm: nrf91: bound modem version parsing#19328
jerpelea merged 1 commit into
apache:masterfrom
Old-Ding:codex/nrf91-bound-modem-version

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bound nRF91 modem version tokens parsed from AT command responses
  • size the temporary buffers to the LTE version fields
  • require both AT%HWVERSION fields before copying them

Root cause

nrf_modem_at_scanf() was using unbounded %s conversions into 16-byte temporary buffers even though the LTE version fields can hold 32 bytes. The two-field AT%HWVERSION parse also copied both buffers when only one field was parsed, which could read an uninitialized temporary buffer.

Testing

  • git diff --check
  • git show --stat --check --format=fuller HEAD

Build not run locally because this Windows machine does not have make, cmake, gcc, clang, or cc installed.

Limit modem version tokens parsed from AT command responses to the LTE version field sizes. Also require both HWVERSION fields before copying them so a partial parse does not read an uninitialized temporary buffer.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@jerpelea jerpelea merged commit 6b7f961 into apache:master Jul 6, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants