Skip to content

Implement NUL byte checks for dbnames #4553

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 3 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 17, 2019

Since we're passing these parameter to C functions accepting char*
without any further checking, we should reject strings with NUL bytes
in the first place.

Since we're passing these parameter to C functions accepting `char*`
without any further checking, we should reject strings with NUL bytes
in the first place.
@cmb69
Copy link
Member Author

cmb69 commented Aug 17, 2019

I've used a type error, but that doesn't seem to be quite right. I'm also unsure about the additional ZEND_NUM_ARGS() checks. And I'm not sure whether the missing NUL byte checks shouldn't be regarded as bug (i.e. be added to PHP-7.2+).

@cmb69
Copy link
Member Author

cmb69 commented Sep 10, 2019

I have changed the TypeError to ValueError.

If there are no objections, I'll merge this PR in a week.

@cmb69 cmb69 closed this Sep 17, 2019
@cmb69 cmb69 deleted the sqlite3-dbname-null branch September 17, 2019 14:41
@cmb69
Copy link
Member Author

cmb69 commented Sep 17, 2019

Applied as 9a734c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants