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

Should casting a char * to _Nt_array_ptr be allowed? #1154

Open
secure-sw-dev-bot opened this issue Jan 17, 2022 · 0 comments
Open

Should casting a char * to _Nt_array_ptr be allowed? #1154

secure-sw-dev-bot opened this issue Jan 17, 2022 · 0 comments
Labels
needs investigation question Further information is requested

Comments

@secure-sw-dev-bot
Copy link

This issue was copied from checkedc/checkedc-clang#1155


Should we allow this type of code?

char *g(_Nt_array_ptr<char> p);

void f(_Nt_array_ptr<char> p) {
  p = (_Nt_array_ptr<char>) g(p);
}

There is no guarantee that the char * returned by the function g() actually contains a null-terminator.

@secure-sw-dev-bot secure-sw-dev-bot added needs investigation question Further information is requested labels Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant