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

DISPATCH-1262: fix GCC 8.2 format-truncation error in router/src/main.c #448

Closed
wants to merge 1 commit into from

Conversation

jirkadanek
Copy link

Gcc warns because getcwd on Linux may allocate and return new buffer,
so don't ignore the returned value. And cur_path may in theory be null
going in if previous calloc failed.

It is unlikely we would end up with cur_path = NULL as parameter to %s
in a formatting string later below, but it is possible, given very
careful timing and sufficiently malicious user, I think.

Change is made to silence GCC warning, so that ``-fsanitize=undefined` compiles.

Gcc warns because `getcwd` on Linux may allocate and return new buffer,
so don't ignore the returned value. And cur_path may in theory be null
going in if previous `calloc` failed.

It is unlikely we would end up with cur_path = NULL as parameter to `%s`
in a formatting string later below, but it is possible, given very
careful timing and sufficiently malicious user, I think.

Change is made to silence GCC warning, so that ``-fsanitize=undefined` compiles.
@asfgit asfgit closed this in ca7d346 Feb 4, 2019
@jirkadanek
Copy link
Author

@ganeshmurthy thanks for looking into this

@jirkadanek jirkadanek deleted the jd_format_truncation branch February 4, 2019 14:45
ChugR pushed a commit to ChugR/qpid-dispatch that referenced this pull request Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants