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

CodeQL warning in doctest header (use after free) #842

Open
cdacamar opened this issue Feb 6, 2024 · 0 comments
Open

CodeQL warning in doctest header (use after free) #842

cdacamar opened this issue Feb 6, 2024 · 0 comments

Comments

@cdacamar
Copy link

cdacamar commented Feb 6, 2024

Description

In one of our repos, we had a CodeQL warning flag the doctest header here:

doctest/doctest/doctest.h

Lines 3700 to 3705 in ae7a135

delete[] data.ptr;
// update the rest of the union members
data.size = total_size;
data.ptr = temp;
// transfer the rest of the data
memcpy(data.ptr + my_old_size, other.c_str(), other_size + 1);

Where the pointer is deleted then used.

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

No branches or pull requests

1 participant