-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Ordered comparison of pointer with integer zero #515
Comments
duplicate of #371 The code is never used for basic usage of this library. To fix this right you have to dig into the rfc specification and program code (there are some more smelling code). Or let it be... :-/ |
Please consider reopening this issue as it blocks compiling an Arduino sketch with Besides, I think looking at the code shows up a bunch of problems in this area which suggest it has no users and could just be deleted or The prototype allows two optional parameters, both pointers, both defaulting to NULL.
The function body always unconditionally dereferences
I don't know C++, only C, but I assume this is just as invalid in C++? That implies Then we have the two uses which guard the memcpy(3), e.g. if (backData && (backLen > 0)) {
if (*backLen < in.inf.size)
return STATUS_NO_ROOM;
*backLen = in.inf.size;
memcpy(backData, in.inf.data, in.inf.size);
} Given
Similarly for the second case: if (backData && (backLen > 0)) {
if ((*backLen + ackDataSize) > totalBackLen)
return STATUS_NO_ROOM;
memcpy(&(backData[*backLen]), ackData, ackDataSize);
*backLen += ackDataSize;
} We've already saved the original size of @salieff, does this seem accurate to you given you've submitted a patch in the past? |
@RalphCorderoy Why reopen? I mentioned that it is a duplicate of #371 . Please write there instead of splitting a problem into multiple issue reports. |
Hi @Rotzbua, Sorry, I thought I was on that earlier issue. I've repeated the comment there. |
Step 0: Are you in the right place?
Yes
Step 1: Describe your environment
Step 2: Describe the problem
Mistypo in if expression
Affected file(s) or example(s):
Steps to reproduce:
Observed Results:
Expected Results:
Relevant Code:
The text was updated successfully, but these errors were encountered: