Skip to content

drivers: modem: quectel-bg9x: fix ICCID prefix strip length - #4616

Open
bjarki-andreasen wants to merge 1 commit into
nrfconnect:ncs-v3.4-branchfrom
bjarki-andreasen:fix_iccid_prefix_strip_length_v3_4_branch
Open

bjarki-andreasen wants to merge 1 commit into
nrfconnect:ncs-v3.4-branchfrom
bjarki-andreasen:fix_iccid_prefix_strip_length_v3_4_branch

Conversation

@bjarki-andreasen

Copy link
Copy Markdown
Contributor

cherry pick of drivers: modem: quectel-bg9x: fix ICCID prefix strip length

…ength

on_cmd_atcmdinfo_iccid() strips the "+QCCID: " prefix by moving the
remaining characters to the start of mdm_iccid. It computed the length
of the remainder into out_len but passed the length of the whole
response line to memmove(). The copy read past the end of mdm_iccid on
every prefixed response, and a response line of 32 characters or more
also wrote past it into the following members of struct modem_data.

Copy out_len + 1 bytes instead. out_len is bounded by the NUL-terminated
contents of mdm_iccid, so the copy stays within the buffer.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>

(cherry picked from commit 37a6803ed8da0307dfa5438208a6c3e4cfde8cf9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backward-compatible A backwards compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants