Skip to content

Conversation

@diffusion4812
Copy link
Contributor

Updated lambda functions in rapidcsv.h to use unsigned char instead of int for parameters in std::all_of and std::find_if. This prevents crashing/exception generation when attempting to parse unsupported (non-CSV) file types.

Updated lambda functions in `rapidcsv.h` to use `unsigned char` instead of `int` for parameters in `std::all_of` and `std::find_if`.
@d99kris d99kris self-assigned this Aug 8, 2025
@d99kris
Copy link
Owner

d99kris commented Aug 8, 2025

Hi @diffusion4812 - thanks for contributing. Could you share an example file which causes the crashing/exception?

So that I can add a test once the fix is merged.

@diffusion4812
Copy link
Contributor Author

Hi, here is a file that fails to parse.
testfile.csv

@d99kris
Copy link
Owner

d99kris commented Aug 9, 2025

Great, thanks, will try review the PR soon.

@d99kris
Copy link
Owner

d99kris commented Aug 16, 2025

Hi again, I was not able to reproduce any crash using the provided file, tested both on Mac/Clang Arm and Linux/GCC Arm. I tested with pTrim = true in SeparatorParams. Are there any other parameters needed to reproduce it, or special environment?

Anyway, the fix is correct as far as I can tell, so I will proceed to merge it. But if you have more details on how to reproduce the crash it's very appreciated, so that I can put in place a test case for catching regressions.

Thanks for contributing!

@d99kris d99kris merged commit 9501529 into d99kris:master Aug 16, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants