http/fetch: Pass a non-null buffer to ne_set_request_body_buffer API#18
Open
kraj wants to merge 1 commit into
Open
http/fetch: Pass a non-null buffer to ne_set_request_body_buffer API#18kraj wants to merge 1 commit into
kraj wants to merge 1 commit into
Conversation
Newer versions of neon has added a check for non-null arguments for
ne_set_request_body_buffer() API and this is triggered but older
compiler only treats -Wnonnull as warning so all was fine, however gcc
12.2 has started to throw this warning as error by default and builds
are breaking
Fixes
src/HTTPFetch.cc:186:38: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
ne_set_request_body_buffer(req,0,0);
~ ^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
I'm a little confused by this change. The code is constructing an HTTP PUT message, and the existing code tries to append a zero length request body. It would appear that this is actually un-necessary, as the declaration has been changed to stop you passing a NULL buffer pointer. The proposed change seems to be adding an arbitrary length, uninitialised buffer as the request body. While that will get rid of the compilation error, it seems like a dangerous thing to do. Couldn't we just remove the call to ne_set_request_body_buffer(), or am I missing something? I've tried this in my local copy and it seems to work fine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Newer versions of neon has added a check for non-null arguments for
ne_set_request_body_buffer() API and this is triggered but older
compiler only treats -Wnonnull as warning so all was fine, however gcc
12.2 has started to throw this warning as error by default and builds
are breaking
Fixes
src/HTTPFetch.cc:186:38: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
ne_set_request_body_buffer(req,0,0);
~ ^
Signed-off-by: Khem Raj raj.khem@gmail.com