-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
warning: -Wnull-dereference with ngtcp2 + gcc 13.1.0 #11147
Comments
This looks similar to warnings you easily get with gcc's
... and that macro checks for There's also an assert there that would trigger if It's not immediately obvious to me how to silence this warning. |
@icing can you give a shot? |
It slips through CI because all ngtcp2 builds have debug enabled, and in those cases the assert catches it. This silences the warning for non-debug builds: --- a/lib/vquic/curl_ngtcp2.c
+++ b/lib/vquic/curl_ngtcp2.c
@@ -1319,6 +1319,8 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf,
(void)cf;
DEBUGASSERT(stream);
+ if(!stream)
+ goto out;
if(stream->reset) {
failf(data,
"HTTP/3 stream %" PRId64 " reset by server", stream->id); |
- compiler analyzer did not include the call context for this static function where the condition had already been checked. - eleminating the problem by making stream a call parameter - refs curl#11147
Pushed #11151 as fix for this. The warning case never happend as this static function was only called in a context where |
- compiler analyzer did not include the call context for this static function where the condition had already been checked. - eleminating the problem by making stream a call parameter Fixes curl#11147 Closes curl#11151
I did this
Built curl with gcc 13.1.0 and got this warning:
I expected the following
No warning.
curl/libcurl version
master @ 446061e
operating system
Cross-building for Windows.
The text was updated successfully, but these errors were encountered: