Skip to content

Fix GH-11982: str_getcsv returns null byte for unterminated enclosure #12047

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
wants to merge 1 commit into from

Conversation

bukka
Copy link
Member

@bukka bukka commented Aug 25, 2023

This is a fix for GH-11982 which is caused by extra increment of the buffer pointer during parsing. It doesn't take into account the fact that it might be incremented too much in case of an enclosure being at the end of line. The fix adds two checks for that in the branches used by str_getcsv and fgetcsv. If it is identified, it goes back by one character.

@bukka
Copy link
Member Author

bukka commented Aug 25, 2023

As this is more edge case and there is a small chance someone handles it already in their code, I'm targeting just master (8.3) for this fix and will also update UPGRADING accordingly just in case.

@bukka bukka closed this in aff46d7 Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant