]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http2: memory errors in the push callbacks are fatal
authorDaniel Stenberg <daniel@haxx.se>
Thu, 7 Mar 2024 15:02:13 +0000 (16:02 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 7 Mar 2024 21:36:49 +0000 (22:36 +0100)
Use the correct nghttp2 error code accordingly.

Closes #13081

lib/http2.c

index 96868728a53a1f096b27205a3faad09dbbcd92c4..4183f08d0ba5609c1925238494d835f6ba5e4047 100644 (file)
@@ -1417,7 +1417,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
       stream->push_headers = malloc(stream->push_headers_alloc *
                                     sizeof(char *));
       if(!stream->push_headers)
-        return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
+        return NGHTTP2_ERR_CALLBACK_FAILURE;
       stream->push_headers_used = 0;
     }
     else if(stream->push_headers_used ==
@@ -1427,14 +1427,14 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
         /* this is beyond crazy many headers, bail out */
         failf(data_s, "Too many PUSH_PROMISE headers");
         free_push_headers(stream);
-        return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
+        return NGHTTP2_ERR_CALLBACK_FAILURE;
       }
       stream->push_headers_alloc *= 2;
       headp = realloc(stream->push_headers,
                       stream->push_headers_alloc * sizeof(char *));
       if(!headp) {
         free_push_headers(stream);
-        return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
+        return NGHTTP2_ERR_CALLBACK_FAILURE;
       }
       stream->push_headers = headp;
     }