Skip to content

Guard short Michelin advertisements - #1590

Merged
Ernst79 merged 1 commit into
custom-components:masterfrom
IoannisArmamentos:fix/michelin-short-advertisements
Sep 8, 2026
Merged

Guard short Michelin advertisements#1590
Ernst79 merged 1 commit into
custom-components:masterfrom
IoannisArmamentos:fix/michelin-short-advertisements

Conversation

@IoannisArmamentos

Copy link
Copy Markdown
Contributor

Summary

Prevent short Michelin TMS advertisements from raising IndexError during parsing.

Problem

parse_michelin_tms() accessed data[5] before validating that the manufacturer data contained at least six bytes.

The shared dispatcher does not enforce a sufficient minimum length for Michelin advertisements, so truncated packets could reach the parser and raise an exception.

Fix

Reject Michelin TMS payloads shorter than six bytes before accessing the frame-type byte.

Valid Michelin advertisements and the existing frame specific validation remain unchanged.

A regression test covers truncated manufacturer data.

@Ernst79
Ernst79 merged commit 2ff6cf9 into custom-components:master Sep 8, 2026
6 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