Skip to content

checked-c-convert: itype(void* ) instead of conversion to checked type #549

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

Closed
secure-sw-dev-bot opened this issue Jan 16, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@secure-sw-dev-bot
Copy link

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


Some odd itype behavior when running checked-c-convert on some memory functions, here's a short repro:

#include <string_checked.h>
void MemoryCopy(void* dest, const void* src, int sSize) {
    if (dest != NULL && src != NULL)
    {
        memmove(dest, src, sSize);
    }
}

Expected conversion (given the definition of memmove):
void MemoryCopy(void *dest : byte_count(sSize), const void *src : byte_count(sSize) , int sSize)

What I saw:
void MemoryCopy(void *dest : itype(void* ), const void *src : itype(_Ptr<const void>), int sSize)

Both itypes are wrong, since memmove requires a byte_count and so cannot be _Ptr type, but the one for dest is especially confused.

@secure-sw-dev-bot secure-sw-dev-bot added the bug Something isn't working label Jan 16, 2022
@secure-sw-dev-bot
Copy link
Author

Comment from @dtarditi:

The convert tool has been mostly rewritten (see PR #642). Please reopen this issue if it still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant