Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for Component ID count exceeding 32 to prevent memory corruption in application firmware #23

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ectf_tools/build_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ def build_ap(
"""

try:
# Check for Component ID count exceeding 32 to prevent memory corruption in application firmware
component_id_list = component_ids.split(",")
if len(component_id_list) != int(component_cnt):
logger.error(f"List of component IDs provided of length does not match component count {component_cnt}")
exit(1)
if len(component_id_list) > 32:
logger.error("Component count cannot exceed 32")
exit(1)

for component_id in component_ids.split(","):
component_id = int(component_id.strip(), 0)
if i2c_address_is_blacklisted(component_id):
Expand Down