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

Potential NULL parameter to strlen #91

Closed
3 tasks done
stumpylog opened this issue Jun 19, 2017 · 2 comments
Closed
3 tasks done

Potential NULL parameter to strlen #91

stumpylog opened this issue Jun 19, 2017 · 2 comments

Comments

@stumpylog
Copy link

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

  • I have read and understood the contributors guide.
  • The issue I am reporting can be replicated
  • The issue I am reporting isn't a duplicate

How familiar are you with the codebase?:

2


[BUG] Expected Behaviour:
If a pointer is NULL, it should not be passed as a parameter or used

[BUG] Actual Behaviour:
In parser.c, starting at line 711, the variable part is allocated. The return is checked for NULL, but only logged. part is then provided as an argument to strlen, which would result in undefined behaviour. But probably a segfault in most cases.

I'd consider it very unlikely to be run into/fail, but since the check for NULL is already there, might as well not use the NULL? Perhaps the call to logg will halt or set an error, but I didn't notice anything

[BUG] Steps to reproduce:
image

Device specifics

Hardware Type: rPi, VPS, etc
OS: N/A

This template was created based on the work of udemy-dl.

@DL6ER
Copy link
Member

DL6ER commented Jun 19, 2017

Thanks for reporting this glitch! See 69bbbf5 for a proposed fix.

@stumpylog
Copy link
Author

That would fix both of the potential issues in parser.c I noticed. Quick work!

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

No branches or pull requests

3 participants