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

libssh: get rid of PATH_MAX #6829

Closed

Conversation

emilengler
Copy link
Contributor

This removes the last occurrence of PATH_MAX inside our libssh
implementation by calculating the path length from the string length of
the two components.

emilengler added a commit to emilengler/curl that referenced this pull request Apr 1, 2021
This removes the last occurrence of PATH_MAX inside our libssh
implementation by calculating the path length from the string length of
the two components.

Closes curl#6829
lib/vssh/libssh.c Outdated Show resolved Hide resolved
emilengler added a commit to emilengler/curl that referenced this pull request Apr 1, 2021
This removes the last occurrence of PATH_MAX inside our libssh
implementation by calculating the path length from the string length of
the two components.

Closes curl#6829
bagder
bagder approved these changes Apr 1, 2021
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

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

Did you try switching to aprintf() instead of malloc + snprintf ? That can avoid having strlens and strings in two places risk at some point deviate when code changes over time.

@emilengler
Copy link
Contributor Author

Did you try switching to aprintf() instead of malloc + snprintf ? That can avoid having strlens and strings in two places risk at some point deviate when code changes over time.

Not yet, I will have a deeper look at it this evening. So far I only focused on getting rid of PATH_MAX due to various reasons

This removes the last occurrence of PATH_MAX inside our libssh
implementation by calculating the path length from the string length of
the two components.

Closes curl#6829
@emilengler
Copy link
Contributor Author

Hey, sorry that Friday evening evolved into Sunday noon. I adjusted the patch to use aprintf(). I think this is ready to be merged.

@jay jay closed this in c1abc66 Apr 6, 2021
@jay
Copy link
Member

jay commented Apr 6, 2021

Thanks

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

Successfully merging this pull request may close these issues.

None yet

3 participants