lowRISC / lowRISC/opentitan

[ujson] CRC incorrect for undeliminated values

Open
#19,373 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Earlgrey-PROD Triaged Priority:P4
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

The CRC values are incorrect when deserialising a bare undeliminated values, such as a single enum.

The C ujson deserialiser reads the trailing newline when deserialising this type, as it has no other way of knowing the last character. This means the deserialilser gets the next whitespace character and the crc calculation includes this character, which is not part of the ujson message so the CRC value is incorrect.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the C ujson deserializer and its CRC calculation for a bare undelimited value such as a single enum. Reproduce the case involving the trailing newline or whitespace, then verify with a focused regression test that the CRC covers only the ujson message.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.