-
Notifications
You must be signed in to change notification settings - Fork 2k
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
gcoap: fix underflow when correcting ETag from cache #19968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it weird that we allow responses with invalid ETag values into our caches in the first place, or that opt_get_opaque can even return values outside the buffer, but that'd probably be out of scope for the bug fix here.
Looks good to me.
Note for other reviewers: The example given in the report is not showing errant behavior, it merely demonstrates that things work fine before and after when given valid inputs.
DEBUG("gcoap: invalid calculated padding length (%lu) for ETag injection " | ||
"during cache lookup.\n", (long unsigned)rem_len); | ||
/* something fishy happened in the request. Better don't return cache entry */ | ||
*cache_hit = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's already false from an earlier check, but it doesn't hurt to be explicit either (the compiler will remove it anyway).
bors merge |
Build failed:
|
Seems completely unrelated. :-( |
bors merge |
Build failed: |
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
19984: dist/testbed-support: Add openmote board [backport 2023.10] r=MrKevinWeiss a=miri64 # Backport of #19979 ### Contribution description As part of fixing the automated release specs test we will need support for another `cc2538` based board. I was able to get the tests passing with adaption here and to the release specs. ### Testing procedure ### Issues/PRs references 19987: gcoap: fix underflow when correcting ETag from cache [backport 2023.10] r=miri64 a=MrKevinWeiss # Backport of #19968 Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com> Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
Contribution description
Fixes an underflow error when getting a new ETag from cache, by returning early.
Testing procedure
I repeated the testing procedures from #17801 (comment) (attention, the expected input for
examples/gcoap
changed slightly in the last year and a half))
Sniffing on
tapbr0
should show something like.Issues/PRs references
Reported off-band.