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

Reject null byte in path to SQLite database file #42

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

SimonFrings
Copy link
Contributor

@SimonFrings SimonFrings commented Sep 9, 2021

When writing a null byte inside your file path to your SQLite database it's possible to receive an TypeError (for PHP >= 7) in return.
For older PHP versions we're already handling the thrown Exception.

Copy link
Owner

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonFrings Thank you for looking into this!

I'm curious, what happens at the moment if we pass a null byte in the path (i.e. is this new logic needed)?

tests/FunctionalDatabaseTest.php Outdated Show resolved Hide resolved
src/Factory.php Outdated Show resolved Hide resolved
src/Factory.php Outdated Show resolved Hide resolved
@clue clue added help wanted Extra attention is needed new feature New feature or request labels Sep 10, 2021
@SimonFrings SimonFrings force-pushed the path branch 2 times, most recently from ceaabc2 to 827a9db Compare September 21, 2021 07:18
@SimonFrings
Copy link
Contributor Author

@clue I didn't noticed that there already was logic for older PHP versions to handle this scenario.
I've updated my changes to fit into the existing logic!

Copy link
Owner

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimonFrings Thanks for the update, changes LGTM! :shipit:

@clue clue merged commit c788322 into clue:master Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants