apache / apache/mynewt-core

No boundary check on od_open_ref

Open
#1,457 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
891
Forks
381
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Both in and `os_dev_open()` and `os_dev_close()` there is no boundary check done while incrementing/decrementing `od_open_ref` value. This leads to an underflow when trying to close an already closed device.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the implementations of os_dev_open() and os_dev_close(), then inspect how they increment and decrement od_open_ref. Confirm the boundary behavior for repeated closes and opens, and consider the issue complete when closing an already closed device no longer underflows the reference count.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.