Open secure-sw-dev-bot opened 2 years ago
Comment from @dtarditi:
This checking isn't implemented in the compiler. The spec requires this checking be implemented. As you point out, all the machinery is there. We just need to include global variables in the list of variables being checked.
This issue was copied from https://github.com/microsoft/checkedc-clang/issues/1191
An assignment to a global variable that is used in the bounds of another global variable does not produce a compile error. This can lead to a buffer overflow when the second global variable is later accessed. In the analogous situation with a local variable, a compile error is correctly reported. Example: