Skip to content

[FIX] libcamhal: Fix TOCTOU and UNINIT defects - #71

Open
deep0294 wants to merge 1 commit into
intel:mainfrom
deep0294:fix-coverity-toctou-uninit-upstream
Open

deep0294 wants to merge 1 commit into
intel:mainfrom
deep0294:fix-coverity-toctou-uninit-upstream

Conversation

@deep0294

Copy link
Copy Markdown

Description

This PR resolves two static analysis defects identified in Coverity scans:

  1. CID 8502504 (TOCTOU / Buffer Hardening in MediaControl):

    • Ensure readlink in MediaControl::getDevnameFromSysfs uses sizeof(target) - 1 and explicitly null-terminates at target[ret].
  2. CID 8504454 (UNINIT in CameraSensorsParser):

    • Initialize int tagType = -1; in CameraSensorsParser::parseGenericStaticMetaData to avoid uninitialized scalar reads.

Reference

Changes:
- Fix CID 8502504 (TOCTOU): Ensure safe buffer size and explicit
  null-termination on readlink in MediaControl::getDevnameFromSysfs
- Fix CID 8504454 (UNINIT): Initialize tagType to -1 in
  CameraSensorsParser::parseGenericStaticMetaData

Change-Id: Icb55fb8ebc8e0696aaf91fc4bed14102c1e513c7
Tracked-On: #JSWBALINUX-258
Signed-off-by: Amarnath Kumar, Deepak <deepak.amarnath.kumar@intel.com>
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