From dc8dc611967bcad660f5191f7b6bcbcbf26cebbf Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 31 Mar 2026 13:54:30 +0100 Subject: [PATCH] C++: Fix type name. --- .../code/cpp/models/implementations/Http.qll | 2 +- .../dataflow/external-models/flow.expected | 74 +++++++++---------- .../dataflow/external-models/sources.expected | 6 +- .../dataflow/external-models/windows.cpp | 7 +- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/models/implementations/Http.qll b/cpp/ql/lib/semmle/code/cpp/models/implementations/Http.qll index 9a51bcede95..a05439a4f2e 100644 --- a/cpp/ql/lib/semmle/code/cpp/models/implementations/Http.qll +++ b/cpp/ql/lib/semmle/code/cpp/models/implementations/Http.qll @@ -3,7 +3,7 @@ private import semmle.code.cpp.ir.dataflow.FlowSteps private import semmle.code.cpp.dataflow.new.DataFlow private class HttpRequest extends Class { - HttpRequest() { this.hasGlobalName("_HTTP_REQUEST") } + HttpRequest() { this.hasGlobalName("_HTTP_REQUEST_V1") } } private class HttpRequestInheritingContent extends TaintInheritingContent, DataFlow::FieldContent { diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index b4968986d7b..4142b09473a 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -332,23 +332,23 @@ edges | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:731:10:731:36 | * ... | provenance | | | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:733:10:733:35 | * ... | provenance | | | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:735:10:735:37 | * ... | provenance | | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:898:15:898:53 | *& ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:902:10:902:31 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:904:10:904:42 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:906:10:906:57 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:908:10:908:60 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:909:54:909:63 | FileHandle | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:911:10:911:70 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:913:10:913:72 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:915:10:915:64 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:917:10:917:51 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:919:10:919:52 | * ... | provenance | Src:MaD:7 | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | windows.cpp:921:10:921:63 | * ... | provenance | Src:MaD:7 | -| windows.cpp:898:15:898:53 | *& ... | windows.cpp:900:10:900:11 | * ... | provenance | | -| windows.cpp:926:70:926:75 | HttpReceiveRequestEntityBody output argument | windows.cpp:928:10:928:16 | * ... | provenance | Src:MaD:8 | -| windows.cpp:933:70:933:78 | HttpReceiveClientCertificate output argument | windows.cpp:934:15:934:48 | *& ... | provenance | Src:MaD:6 | -| windows.cpp:933:70:933:78 | HttpReceiveClientCertificate output argument | windows.cpp:938:10:938:31 | * ... | provenance | Src:MaD:6 | -| windows.cpp:934:15:934:48 | *& ... | windows.cpp:936:10:936:11 | * ... | provenance | | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:901:15:901:53 | *& ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:905:10:905:31 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:907:10:907:42 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:909:10:909:57 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:911:10:911:60 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:912:54:912:63 | FileHandle | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:914:10:914:70 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:916:10:916:72 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:918:10:918:64 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:920:10:920:51 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:922:10:922:52 | * ... | provenance | Src:MaD:7 | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | windows.cpp:924:10:924:63 | * ... | provenance | Src:MaD:7 | +| windows.cpp:901:15:901:53 | *& ... | windows.cpp:903:10:903:11 | * ... | provenance | | +| windows.cpp:929:70:929:75 | HttpReceiveRequestEntityBody output argument | windows.cpp:931:10:931:16 | * ... | provenance | Src:MaD:8 | +| windows.cpp:936:70:936:78 | HttpReceiveClientCertificate output argument | windows.cpp:937:15:937:48 | *& ... | provenance | Src:MaD:6 | +| windows.cpp:936:70:936:78 | HttpReceiveClientCertificate output argument | windows.cpp:941:10:941:31 | * ... | provenance | Src:MaD:6 | +| windows.cpp:937:15:937:48 | *& ... | windows.cpp:939:10:939:11 | * ... | provenance | | nodes | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | semmle.label | [summary param] *0 in buffer | | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | semmle.label | [summary] to write: ReturnValue in buffer | @@ -656,26 +656,26 @@ nodes | windows.cpp:731:10:731:36 | * ... | semmle.label | * ... | | windows.cpp:733:10:733:35 | * ... | semmle.label | * ... | | windows.cpp:735:10:735:37 | * ... | semmle.label | * ... | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | semmle.label | HttpReceiveHttpRequest output argument | -| windows.cpp:898:15:898:53 | *& ... | semmle.label | *& ... | -| windows.cpp:900:10:900:11 | * ... | semmle.label | * ... | -| windows.cpp:902:10:902:31 | * ... | semmle.label | * ... | -| windows.cpp:904:10:904:42 | * ... | semmle.label | * ... | -| windows.cpp:906:10:906:57 | * ... | semmle.label | * ... | -| windows.cpp:908:10:908:60 | * ... | semmle.label | * ... | -| windows.cpp:909:54:909:63 | FileHandle | semmle.label | FileHandle | -| windows.cpp:911:10:911:70 | * ... | semmle.label | * ... | -| windows.cpp:913:10:913:72 | * ... | semmle.label | * ... | -| windows.cpp:915:10:915:64 | * ... | semmle.label | * ... | -| windows.cpp:917:10:917:51 | * ... | semmle.label | * ... | -| windows.cpp:919:10:919:52 | * ... | semmle.label | * ... | -| windows.cpp:921:10:921:63 | * ... | semmle.label | * ... | -| windows.cpp:926:70:926:75 | HttpReceiveRequestEntityBody output argument | semmle.label | HttpReceiveRequestEntityBody output argument | -| windows.cpp:928:10:928:16 | * ... | semmle.label | * ... | -| windows.cpp:933:70:933:78 | HttpReceiveClientCertificate output argument | semmle.label | HttpReceiveClientCertificate output argument | -| windows.cpp:934:15:934:48 | *& ... | semmle.label | *& ... | -| windows.cpp:936:10:936:11 | * ... | semmle.label | * ... | -| windows.cpp:938:10:938:31 | * ... | semmle.label | * ... | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | semmle.label | HttpReceiveHttpRequest output argument | +| windows.cpp:901:15:901:53 | *& ... | semmle.label | *& ... | +| windows.cpp:903:10:903:11 | * ... | semmle.label | * ... | +| windows.cpp:905:10:905:31 | * ... | semmle.label | * ... | +| windows.cpp:907:10:907:42 | * ... | semmle.label | * ... | +| windows.cpp:909:10:909:57 | * ... | semmle.label | * ... | +| windows.cpp:911:10:911:60 | * ... | semmle.label | * ... | +| windows.cpp:912:54:912:63 | FileHandle | semmle.label | FileHandle | +| windows.cpp:914:10:914:70 | * ... | semmle.label | * ... | +| windows.cpp:916:10:916:72 | * ... | semmle.label | * ... | +| windows.cpp:918:10:918:64 | * ... | semmle.label | * ... | +| windows.cpp:920:10:920:51 | * ... | semmle.label | * ... | +| windows.cpp:922:10:922:52 | * ... | semmle.label | * ... | +| windows.cpp:924:10:924:63 | * ... | semmle.label | * ... | +| windows.cpp:929:70:929:75 | HttpReceiveRequestEntityBody output argument | semmle.label | HttpReceiveRequestEntityBody output argument | +| windows.cpp:931:10:931:16 | * ... | semmle.label | * ... | +| windows.cpp:936:70:936:78 | HttpReceiveClientCertificate output argument | semmle.label | HttpReceiveClientCertificate output argument | +| windows.cpp:937:15:937:48 | *& ... | semmle.label | *& ... | +| windows.cpp:939:10:939:11 | * ... | semmle.label | * ... | +| windows.cpp:941:10:941:31 | * ... | semmle.label | * ... | subpaths | asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | asio_streams.cpp:100:44:100:62 | call to buffer | | azure.cpp:257:5:257:8 | *resp | azure.cpp:113:16:113:19 | [summary param] this in Read | azure.cpp:113:16:113:19 | [summary param] *0 in Read [Return] | azure.cpp:257:16:257:21 | Read output argument | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected index ca37eaf98b3..b46aa87af6f 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected @@ -32,6 +32,6 @@ | windows.cpp:669:70:669:79 | WinHttpQueryHeadersEx output argument | remote | | windows.cpp:669:82:669:87 | WinHttpQueryHeadersEx output argument | remote | | windows.cpp:669:105:669:112 | WinHttpQueryHeadersEx output argument | remote | -| windows.cpp:897:64:897:77 | HttpReceiveHttpRequest output argument | remote | -| windows.cpp:926:70:926:75 | HttpReceiveRequestEntityBody output argument | remote | -| windows.cpp:933:70:933:78 | HttpReceiveClientCertificate output argument | remote | +| windows.cpp:900:64:900:77 | HttpReceiveHttpRequest output argument | remote | +| windows.cpp:929:70:929:75 | HttpReceiveRequestEntityBody output argument | remote | +| windows.cpp:936:70:936:78 | HttpReceiveClientCertificate output argument | remote | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/windows.cpp b/cpp/ql/test/library-tests/dataflow/external-models/windows.cpp index 9fb213f5f3a..f098f7344e4 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/windows.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/windows.cpp @@ -836,7 +836,7 @@ typedef struct _HTTP_SSL_INFO { ULONG SslClientCertNegotiated; } HTTP_SSL_INFO, *PHTTP_SSL_INFO; -typedef struct _HTTP_REQUEST { +typedef struct _HTTP_REQUEST_V1 { ULONG Flags; HTTP_CONNECTION_ID ConnectionId; HTTP_REQUEST_ID RequestId; @@ -855,7 +855,10 @@ typedef struct _HTTP_REQUEST { PHTTP_DATA_CHUNK pEntityChunks; HTTP_RAW_CONNECTION_ID RawConnectionId; PHTTP_SSL_INFO pSslInfo; -} HTTP_REQUEST, *PHTTP_REQUEST; +} HTTP_REQUEST_V1, *PHTTP_REQUEST_V1; + +using HTTP_REQUEST = HTTP_REQUEST_V1; +using PHTTP_REQUEST = PHTTP_REQUEST_V1; ULONG HttpReceiveHttpRequest( HANDLE RequestQueueHandle,