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

XDG_CONFIG_HOME not used / potential overflow #64

Closed
steven-joruk opened this issue Aug 18, 2015 · 4 comments
Closed

XDG_CONFIG_HOME not used / potential overflow #64

steven-joruk opened this issue Aug 18, 2015 · 4 comments

Comments

@steven-joruk
Copy link

I have a patch for this but as I'm in work I can't build and test it - https://gist.github.com/steven-jackson/b388215f239af9f9bfe0

sway/config.c Lines 43 and 96

As you can see the home variable is copied to temp, but xdg_config_home contains the path that should be copied. If home is larger than xdg_config_home then an overflow can occur.

@ddevault
Copy link
Contributor

Thanks! I fixed that bug, but I didn't feel that it was necessary to merge your entire patch for several reasons.

@steven-joruk
Copy link
Author

Okay...

@ddevault
Copy link
Contributor

Well, to elaborate:

  • Several style errors in your code
  • Not convinced it's necessary to add a whole join function
  • This code is slated to be rewritten later anyway

So, not worth the effort.

@steven-joruk
Copy link
Author

  1. It matches the style perfectly - there is already inconsistent attachment of pointers to types / identifiers and inconsistent use of space before an opening bracket.
  2. You can check for a NULL return from malloc in a single place instead of fixing it in each place, which is what I should have done.
  3. Irrelevant

Apparently it wasn't worth my effort either.

@swaywm swaywm locked and limited conversation to collaborators Aug 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants