Skip to content

fix(moderate): add bounds checking to prevent buffer overflow in example - #35

Open
lahirunirmalx wants to merge 1 commit into
CuriousScientist0:mainfrom
lahirunirmalx:dev-bounds-check
Open

fix(moderate): add bounds checking to prevent buffer overflow in example#35
lahirunirmalx wants to merge 1 commit into
CuriousScientist0:mainfrom
lahirunirmalx:dev-bounds-check

Conversation

@lahirunirmalx

Copy link
Copy Markdown
  • Add bounds check for single-ended channel selection (0-7)
  • Add bounds check for differential channel selection (0-3)
  • Add bounds check for PGA selection (0-6)
  • Add bounds check for DRATE selection (0-15)
  • Add bounds check for register read (0-10)
  • Add bounds check for register write (0-10)
  • Print error messages for invalid inputs instead of crashing
  • Add confirmation message for register write operations

Prevents undefined behavior when user sends out-of-range values via serial

- Add bounds check for single-ended channel selection (0-7)
- Add bounds check for differential channel selection (0-3)
- Add bounds check for PGA selection (0-6)
- Add bounds check for DRATE selection (0-15)
- Add bounds check for register read (0-10)
- Add bounds check for register write (0-10)
- Print error messages for invalid inputs instead of crashing
- Add confirmation message for register write operations

Prevents undefined behavior when user sends out-of-range values via serial
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.

1 participant