Skip to content

car_helpers: compare VIN with != instead of is not#3524

Open
Jiming-C wants to merge 1 commit into
commaai:masterfrom
Jiming-C:fix-vin-identity-comparison
Open

car_helpers: compare VIN with != instead of is not#3524
Jiming-C wants to merge 1 commit into
commaai:masterfrom
Jiming-C:fix-vin-identity-comparison

Conversation

@Jiming-C

@Jiming-C Jiming-C commented Jul 9, 2026

Copy link
Copy Markdown

VIN_UNKNOWN is a string ("0" * 17), so carVin is not VIN_UNKNOWN checks object identity rather than value. A carVin read back from a cached CarParams is a different object, so the guard is effectively always true and an unknown cached VIN gets treated as valid. Use != to compare by value as intended.

Validation

  • Dongle ID: N/A (one-line correctness fix; no behavior change for a valid cached VIN)
  • Route: N/A

VIN_UNKNOWN is a string ("0" * 17), so `carVin is not VIN_UNKNOWN` checks
object identity rather than value. A carVin read back from cached CarParams
is a different object, so the guard is effectively always true and an unknown
cached VIN is treated as valid. Use != to compare by value as intended.
@github-actions github-actions Bot added the car related to opendbc/car/ label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ No changes detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant