Skip to content

FROMGIT: power: supply: qcom_battmgr: fix battery chemistry strncmp … - #81

Open
tingguoc wants to merge 1340 commits into
qualcomm-linux:resolute-qcom-develfrom
tingguoc:resolute-qcom-devel
Open

tingguoc wants to merge 1340 commits into
qualcomm-linux:resolute-qcom-develfrom
tingguoc:resolute-qcom-devel

Conversation

@tingguoc

@tingguoc tingguoc commented Aug 19, 2026 •

Copy link
Copy Markdown

FROMGIT: power: supply: qcom_battmgr: fix battery chemistry strncmp

The battery_chemistry field is a 4-byte array without guaranteed null termination. Using BATTMGR_CHEMISTRY_LEN (4) as the strncmp length for 3-character string literals implicitly requires chemistry[3] == '\0', which may not hold. Use 3 instead to match only the significant bytes.

Link: https://lore.kernel.org/all/20260812-fix-qcom-batt-chemistry-strn-v1-1-458545e02641@oss.qualcomm.com/

CRs-Fixed: 4562260

Loading
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.