mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Clean up Brotli test
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
edges
|
edges
|
||||||
| brotliTest.cpp:26:41:26:44 | **argv | brotliTest.cpp:26:41:26:44 | **argv | provenance | |
|
| brotliTest.cpp:15:41:15:44 | **argv | brotliTest.cpp:15:41:15:44 | **argv | provenance | |
|
||||||
| brotliTest.cpp:26:41:26:44 | **argv | brotliTest.cpp:28:42:28:60 | *access to array | provenance | |
|
| brotliTest.cpp:15:41:15:44 | **argv | brotliTest.cpp:18:35:18:53 | *access to array | provenance | |
|
||||||
| brotliTest.cpp:26:41:26:44 | **argv | brotliTest.cpp:34:35:34:40 | *input2 | provenance | TaintFunction |
|
| brotliTest.cpp:15:41:15:44 | **argv | brotliTest.cpp:21:30:21:52 | *access to array | provenance | |
|
||||||
|
| brotliTest.cpp:21:30:21:52 | *access to array | brotliTest.cpp:24:51:24:58 | **& ... | provenance | |
|
||||||
| libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:16:31:16:32 | *ar | provenance | |
|
| libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:16:31:16:32 | *ar | provenance | |
|
||||||
| libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:22:41:22:42 | *ar | provenance | |
|
| libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:22:41:22:42 | *ar | provenance | |
|
||||||
| libarchiveTests.cpp:30:45:30:48 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | provenance | |
|
| libarchiveTests.cpp:30:45:30:48 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | provenance | |
|
||||||
@@ -15,7 +16,7 @@ edges
|
|||||||
| main.cpp:7:33:7:36 | **argv | main.cpp:9:27:9:30 | **argv | provenance | |
|
| main.cpp:7:33:7:36 | **argv | main.cpp:9:27:9:30 | **argv | provenance | |
|
||||||
| main.cpp:7:33:7:36 | **argv | main.cpp:10:24:10:27 | **argv | provenance | |
|
| main.cpp:7:33:7:36 | **argv | main.cpp:10:24:10:27 | **argv | provenance | |
|
||||||
| main.cpp:7:33:7:36 | **argv | main.cpp:11:21:11:24 | **argv | provenance | |
|
| main.cpp:7:33:7:36 | **argv | main.cpp:11:21:11:24 | **argv | provenance | |
|
||||||
| main.cpp:8:23:8:26 | **argv | brotliTest.cpp:26:41:26:44 | **argv | provenance | |
|
| main.cpp:8:23:8:26 | **argv | brotliTest.cpp:15:41:15:44 | **argv | provenance | |
|
||||||
| main.cpp:8:23:8:26 | **argv | main.cpp:8:23:8:26 | brotli_test output argument | provenance | |
|
| main.cpp:8:23:8:26 | **argv | main.cpp:8:23:8:26 | brotli_test output argument | provenance | |
|
||||||
| main.cpp:8:23:8:26 | brotli_test output argument | main.cpp:9:27:9:30 | **argv | provenance | |
|
| main.cpp:8:23:8:26 | brotli_test output argument | main.cpp:9:27:9:30 | **argv | provenance | |
|
||||||
| main.cpp:8:23:8:26 | brotli_test output argument | main.cpp:10:24:10:27 | **argv | provenance | |
|
| main.cpp:8:23:8:26 | brotli_test output argument | main.cpp:10:24:10:27 | **argv | provenance | |
|
||||||
@@ -82,10 +83,11 @@ edges
|
|||||||
| zlibTest.cpp:84:18:84:24 | UnsafeGzread output argument | zlibTest.cpp:85:19:85:25 | *access to array | provenance | |
|
| zlibTest.cpp:84:18:84:24 | UnsafeGzread output argument | zlibTest.cpp:85:19:85:25 | *access to array | provenance | |
|
||||||
| zlibTest.cpp:85:19:85:25 | *access to array | zlibTest.cpp:71:26:71:30 | *input | provenance | |
|
| zlibTest.cpp:85:19:85:25 | *access to array | zlibTest.cpp:71:26:71:30 | *input | provenance | |
|
||||||
nodes
|
nodes
|
||||||
| brotliTest.cpp:26:41:26:44 | **argv | semmle.label | **argv |
|
| brotliTest.cpp:15:41:15:44 | **argv | semmle.label | **argv |
|
||||||
| brotliTest.cpp:26:41:26:44 | **argv | semmle.label | **argv |
|
| brotliTest.cpp:15:41:15:44 | **argv | semmle.label | **argv |
|
||||||
| brotliTest.cpp:28:42:28:60 | *access to array | semmle.label | *access to array |
|
| brotliTest.cpp:18:35:18:53 | *access to array | semmle.label | *access to array |
|
||||||
| brotliTest.cpp:34:35:34:40 | *input2 | semmle.label | *input2 |
|
| brotliTest.cpp:21:30:21:52 | *access to array | semmle.label | *access to array |
|
||||||
|
| brotliTest.cpp:24:51:24:58 | **& ... | semmle.label | **& ... |
|
||||||
| libarchiveTests.cpp:16:31:16:32 | *ar | semmle.label | *ar |
|
| libarchiveTests.cpp:16:31:16:32 | *ar | semmle.label | *ar |
|
||||||
| libarchiveTests.cpp:16:31:16:32 | *ar | semmle.label | *ar |
|
| libarchiveTests.cpp:16:31:16:32 | *ar | semmle.label | *ar |
|
||||||
| libarchiveTests.cpp:22:41:22:42 | *ar | semmle.label | *ar |
|
| libarchiveTests.cpp:22:41:22:42 | *ar | semmle.label | *ar |
|
||||||
@@ -149,7 +151,7 @@ nodes
|
|||||||
| zlibTest.cpp:85:19:85:25 | *access to array | semmle.label | *access to array |
|
| zlibTest.cpp:85:19:85:25 | *access to array | semmle.label | *access to array |
|
||||||
subpaths
|
subpaths
|
||||||
| libarchiveTests.cpp:38:27:38:27 | *a | libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:38:27:38:27 | read_data output argument |
|
| libarchiveTests.cpp:38:27:38:27 | *a | libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:16:31:16:32 | *ar | libarchiveTests.cpp:38:27:38:27 | read_data output argument |
|
||||||
| main.cpp:8:23:8:26 | **argv | brotliTest.cpp:26:41:26:44 | **argv | brotliTest.cpp:26:41:26:44 | **argv | main.cpp:8:23:8:26 | brotli_test output argument |
|
| main.cpp:8:23:8:26 | **argv | brotliTest.cpp:15:41:15:44 | **argv | brotliTest.cpp:15:41:15:44 | **argv | main.cpp:8:23:8:26 | brotli_test output argument |
|
||||||
| main.cpp:9:27:9:30 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | main.cpp:9:27:9:30 | libarchive_test output argument |
|
| main.cpp:9:27:9:30 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | libarchiveTests.cpp:30:45:30:48 | **argv | main.cpp:9:27:9:30 | libarchive_test output argument |
|
||||||
| main.cpp:10:24:10:27 | **argv | minizipTest.cpp:12:42:12:45 | **argv | minizipTest.cpp:12:42:12:45 | **argv | main.cpp:10:24:10:27 | minizip_test output argument |
|
| main.cpp:10:24:10:27 | **argv | minizipTest.cpp:12:42:12:45 | **argv | minizipTest.cpp:12:42:12:45 | **argv | main.cpp:10:24:10:27 | minizip_test output argument |
|
||||||
| zlibTest.cpp:81:19:81:25 | *access to array | zlibTest.cpp:47:26:47:33 | *fileName | zlibTest.cpp:47:26:47:33 | *fileName | zlibTest.cpp:81:19:81:25 | UnsafeGzfread output argument |
|
| zlibTest.cpp:81:19:81:25 | *access to array | zlibTest.cpp:47:26:47:33 | *fileName | zlibTest.cpp:47:26:47:33 | *fileName | zlibTest.cpp:81:19:81:25 | UnsafeGzfread output argument |
|
||||||
@@ -157,8 +159,8 @@ subpaths
|
|||||||
| zlibTest.cpp:83:19:83:25 | *access to array | zlibTest.cpp:16:26:16:30 | *input | zlibTest.cpp:16:26:16:30 | *input | zlibTest.cpp:83:19:83:25 | UnsafeInflate output argument |
|
| zlibTest.cpp:83:19:83:25 | *access to array | zlibTest.cpp:16:26:16:30 | *input | zlibTest.cpp:16:26:16:30 | *input | zlibTest.cpp:83:19:83:25 | UnsafeInflate output argument |
|
||||||
| zlibTest.cpp:84:18:84:24 | *access to array | zlibTest.cpp:37:25:37:32 | *fileName | zlibTest.cpp:37:25:37:32 | *fileName | zlibTest.cpp:84:18:84:24 | UnsafeGzread output argument |
|
| zlibTest.cpp:84:18:84:24 | *access to array | zlibTest.cpp:37:25:37:32 | *fileName | zlibTest.cpp:37:25:37:32 | *fileName | zlibTest.cpp:84:18:84:24 | UnsafeGzread output argument |
|
||||||
#select
|
#select
|
||||||
| brotliTest.cpp:28:42:28:60 | *access to array | main.cpp:7:33:7:36 | **argv | brotliTest.cpp:28:42:28:60 | *access to array | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
| brotliTest.cpp:18:35:18:53 | *access to array | main.cpp:7:33:7:36 | **argv | brotliTest.cpp:18:35:18:53 | *access to array | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
||||||
| brotliTest.cpp:34:35:34:40 | *input2 | main.cpp:7:33:7:36 | **argv | brotliTest.cpp:34:35:34:40 | *input2 | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
| brotliTest.cpp:24:51:24:58 | **& ... | main.cpp:7:33:7:36 | **argv | brotliTest.cpp:24:51:24:58 | **& ... | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
||||||
| libarchiveTests.cpp:22:41:22:42 | *ar | main.cpp:7:33:7:36 | **argv | libarchiveTests.cpp:22:41:22:42 | *ar | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
| libarchiveTests.cpp:22:41:22:42 | *ar | main.cpp:7:33:7:36 | **argv | libarchiveTests.cpp:22:41:22:42 | *ar | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
||||||
| minizipTest.cpp:17:52:17:67 | *access to array | main.cpp:7:33:7:36 | **argv | minizipTest.cpp:17:52:17:67 | *access to array | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
| minizipTest.cpp:17:52:17:67 | *access to array | main.cpp:7:33:7:36 | **argv | minizipTest.cpp:17:52:17:67 | *access to array | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
||||||
| minizipTest.cpp:26:30:26:39 | **zip_reader | main.cpp:7:33:7:36 | **argv | minizipTest.cpp:26:30:26:39 | **zip_reader | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
| minizipTest.cpp:26:30:26:39 | **zip_reader | main.cpp:7:33:7:36 | **argv | minizipTest.cpp:26:30:26:39 | **zip_reader | This Decompression output $@. | main.cpp:7:33:7:36 | **argv | is not limited |
|
||||||
|
|||||||
@@ -1,37 +1,26 @@
|
|||||||
typedef long unsigned int size_t;
|
typedef long unsigned int size_t;
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef enum {
|
|
||||||
} BrotliDecoderResult;
|
enum BrotliDecoderResult {};
|
||||||
|
struct BrotliDecoderState;
|
||||||
|
|
||||||
BrotliDecoderResult BrotliDecoderDecompress(
|
BrotliDecoderResult BrotliDecoderDecompress(
|
||||||
size_t encoded_size,
|
size_t encoded_size, const uint8_t encoded_buffer[],
|
||||||
const uint8_t encoded_buffer[],
|
size_t *decoded_size, uint8_t decoded_buffer[]);
|
||||||
size_t *decoded_size,
|
|
||||||
uint8_t decoded_buffer[]) { return static_cast<BrotliDecoderResult>(0); };
|
|
||||||
|
|
||||||
void strncpy(char *string, const char *string1, int i);
|
|
||||||
|
|
||||||
typedef struct BrotliDecoderStateStruct BrotliDecoderState;
|
|
||||||
|
|
||||||
BrotliDecoderResult BrotliDecoderDecompressStream(
|
BrotliDecoderResult BrotliDecoderDecompressStream(
|
||||||
BrotliDecoderState *state, size_t *available_in, const uint8_t **next_in,
|
BrotliDecoderState *state, size_t *available_in, const uint8_t **next_in,
|
||||||
size_t *available_out, uint8_t **next_out, size_t *total_out) { return static_cast<BrotliDecoderResult>(0); };
|
size_t *available_out, uint8_t **next_out, size_t *total_out);
|
||||||
|
|
||||||
namespace std {
|
|
||||||
void strncpy(char *string, const char *string1, int i) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void brotli_test(int argc, const char **argv) {
|
void brotli_test(int argc, const char **argv) {
|
||||||
uint8_t *output = nullptr;
|
uint8_t output[1024];
|
||||||
BrotliDecoderDecompress(1024 * 1024, (uint8_t *) argv[2], // BAD
|
size_t output_size = sizeof(output);
|
||||||
reinterpret_cast<size_t *>(1024 * 1024 * 1024), output);
|
BrotliDecoderDecompress(1024, (uint8_t *) argv[2], &output_size, output); // BAD
|
||||||
uint8_t **output2 = nullptr;
|
|
||||||
const uint8_t **input2 = nullptr;
|
size_t input_size = 1024;
|
||||||
std::strncpy(reinterpret_cast<char *>(input2), argv[2], 32);
|
const uint8_t *input_p = (const uint8_t*)argv[2];
|
||||||
BrotliDecoderDecompressStream(0, reinterpret_cast<size_t *>(1024 * 1024),
|
uint8_t *output_p = output;
|
||||||
input2, reinterpret_cast<size_t *>(1024 * 1024 * 1024), // BAD
|
size_t out_size;
|
||||||
output2,
|
BrotliDecoderDecompressStream(0, &input_size, &input_p, &output_size, // BAD
|
||||||
reinterpret_cast<size_t *>(1024 * 1024 * 1024));
|
&output_p, &out_size);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user