checkedc / checkedc-llvm-project

This was a fork of Checked C clang used from 2021-2024. The changes have been merged into the original Checked C clang repo, which is now at https://github.com/checkedc/checkedc-clang.
https://www.checkedc.org
13 stars 19 forks source link

Bounds checking bounds-safe interfaces in unchecked scopes #1166

Closed secure-sw-dev-bot closed 2 years ago

secure-sw-dev-bot commented 2 years ago

This issue was copied from https://github.com/microsoft/checkedc-clang/issues/1169


Fixes #1158

This PR updates the bounds checking behavior for lvalue expressions with bounds-safe interfaces in unchecked scopes.

If:

  1. A statement S is in an unchecked scope, and:
  2. An lvalue expression e has unchecked pointer type (its bounds were declared using a bounds-safe interface), and:
  3. S does not contain an assignment e = e1 where e1 is a checked pointer, then:

The bounds of e are not validated after checking S.