-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fix possible buffer overflow #275
Conversation
The files to check are: libhdt/src/libdcs/CSD_FMIndex.cpp The other files are straightforward responses to compiler warnings. |
3dc4aea
to
e58ebbf
Compare
The code now compiles cleanly using gcc-13.2 with |
This is ready to merge into branch Or I can do the merge on my local copy and push to branch Once that is done, I'll create a PR for the |
I reviewed my changes and realize that there's a mistake in the calls to |
…Intel compiler.
… from the data directory under revision control instead of user-supplied input to support automated testing.
bitclean war previously implemented for size_t and uint32_t, which overlap on 32 bit architectures. Implementing it for uint32_t and uint64_t might leave the latter unused on 32 bit builds, but is consistent and works on both. Closes: rdfhdt#143
I've looked at the 5 conflicts, and in each case, the first one ("develop-buffer") should be chosen (except, you might choose to ignore my "TODO"). I suspect that there are other potential buffer overflows in the code -- it would have been better if C++ |
This PR has been superseded by #283 (same changes but no bogus merge conflicts). |
This PR should be applied to branch
develop
.These changes are because the compiler pointed out mis-use of
strncmp()
andmemcpy()
. I think that I've fixed the problems, but it's easy to make an off-by-one error in such code, so please review.(A better way of fixing this would be to use
std::string
orstd::basic_string<unsigned char>
)