Skip to content

Prevent crash when passing NULL to hash_string#395

Open
prjanitor wants to merge 1 commit intoAdeptLanguage:masterfrom
prjanitor:prjanitor/4604b349a34140f884589b9ae4f59a4288a796b3
Open

Prevent crash when passing NULL to hash_string#395
prjanitor wants to merge 1 commit intoAdeptLanguage:masterfrom
prjanitor:prjanitor/4604b349a34140f884589b9ae4f59a4288a796b3

Conversation

@prjanitor
Copy link
Copy Markdown

The function hash_string was calling strlen(s) without checking if the input pointer s is NULL. This would cause a segmentation fault/crash if a NULL string was passed. Added a null check to return 0 in such cases.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

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.

1 participant