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
wants to merge 1 commit into from

Conversation

cvengler
Copy link
Contributor

@cvengler cvengler commented 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.

@cvengler cvengler force-pushed the 2021-04-libssh-no-path-max branch from 67b700e to 9a07794 Compare April 1, 2021 16:34
lib/vssh/libssh.c Outdated Show resolved Hide resolved
cvengler added a commit to cvengler/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
@cvengler cvengler force-pushed the 2021-04-libssh-no-path-max branch from 9a07794 to bfff6dc Compare April 1, 2021 19:17
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.

@cvengler
Copy link
Contributor Author

cvengler commented Apr 2, 2021

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
@cvengler cvengler force-pushed the 2021-04-libssh-no-path-max branch from bfff6dc to e5e5b3c Compare April 4, 2021 11:08
@cvengler
Copy link
Contributor Author

cvengler commented Apr 4, 2021

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
Development

Successfully merging this pull request may close these issues.

3 participants