diff --git a/.github/workflows/3.0-coveralls.yml b/.github/workflows/3.0-coveralls.yml index a8dece364..fd668f809 100644 --- a/.github/workflows/3.0-coveralls.yml +++ b/.github/workflows/3.0-coveralls.yml @@ -70,7 +70,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: diff --git a/.github/workflows/3.0-macos-debug.yml b/.github/workflows/3.0-macos-debug.yml index 2943e2a7c..8ab2e8528 100644 --- a/.github/workflows/3.0-macos-debug.yml +++ b/.github/workflows/3.0-macos-debug.yml @@ -64,7 +64,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: | diff --git a/.github/workflows/3.0-macos-release.yml b/.github/workflows/3.0-macos-release.yml index b745ac067..b6f724d1f 100644 --- a/.github/workflows/3.0-macos-release.yml +++ b/.github/workflows/3.0-macos-release.yml @@ -64,7 +64,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: | diff --git a/.github/workflows/3.0-non-x64.yml b/.github/workflows/3.0-non-x64.yml index 4846f5eb8..68bae53b6 100644 --- a/.github/workflows/3.0-non-x64.yml +++ b/.github/workflows/3.0-non-x64.yml @@ -134,7 +134,7 @@ jobs: echo "clone TDengine 3.0 on ${{ steps.setup.outputs.uname }}" - git clone --branch fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1 + git clone --branch chore/sangshuduo/TD-22652-stringop-overflow --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1 echo "build TDengine 3.0 on ${{ steps.setup.outputs.uname }}" cd TDengine || exit 1 diff --git a/.github/workflows/3.0-taosBenchmark-debug.yml b/.github/workflows/3.0-taosBenchmark-debug.yml index 03355d6b5..aa2dd6610 100644 --- a/.github/workflows/3.0-taosBenchmark-debug.yml +++ b/.github/workflows/3.0-taosBenchmark-debug.yml @@ -61,7 +61,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: | diff --git a/.github/workflows/3.0-taosBenchmark-release.yml b/.github/workflows/3.0-taosBenchmark-release.yml index 6bec27677..3505c0e13 100644 --- a/.github/workflows/3.0-taosBenchmark-release.yml +++ b/.github/workflows/3.0-taosBenchmark-release.yml @@ -61,7 +61,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: | diff --git a/.github/workflows/3.0-taosdump-debug.yml b/.github/workflows/3.0-taosdump-debug.yml index 0f251a9ed..ade2a6551 100644 --- a/.github/workflows/3.0-taosdump-debug.yml +++ b/.github/workflows/3.0-taosdump-debug.yml @@ -65,7 +65,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: diff --git a/.github/workflows/3.0-taosdump-release-ws.yml b/.github/workflows/3.0-taosdump-release-ws.yml index 4325182fc..d17cd401a 100644 --- a/.github/workflows/3.0-taosdump-release-ws.yml +++ b/.github/workflows/3.0-taosdump-release-ws.yml @@ -65,7 +65,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: diff --git a/.github/workflows/3.0-taosdump-release.yml b/.github/workflows/3.0-taosdump-release.yml index 5ba2e5253..4b1a93742 100644 --- a/.github/workflows/3.0-taosdump-release.yml +++ b/.github/workflows/3.0-taosdump-release.yml @@ -65,7 +65,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: Change time zone if: diff --git a/.github/workflows/3.0-windows-build.yml b/.github/workflows/3.0-windows-build.yml index 0c4a06844..bdb53750c 100644 --- a/.github/workflows/3.0-windows-build.yml +++ b/.github/workflows/3.0-windows-build.yml @@ -62,7 +62,7 @@ jobs: with: repository: 'taosdata/TDengine' path: 'TDengine' - ref: 'fix/sangshuduo/TD-21932-taosbenchmark-data-gen-refactor' + ref: 'chore/sangshuduo/TD-22652-stringop-overflow' - name: create debug directory if: | diff --git a/deps/toolscJson/src/toolscJson.c b/deps/toolscJson/src/toolscJson.c index 4707843af..bb138c13b 100644 --- a/deps/toolscJson/src/toolscJson.c +++ b/deps/toolscJson/src/toolscJson.c @@ -289,8 +289,6 @@ static tools_cJSON_bool parse_number(tools_cJSON * const item, parse_buffer * co input_buffer->offset += (size_t)(after_end - number_c_string); - strncpy(item->numberstring, (const char *)number_c_string, strlen((const char*)number_c_string)); - return true; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e58909723..25eecb070 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -300,7 +300,7 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin IF (CMAKE_C_COMPILER_ID MATCHES "GNU") MESSAGE("Compiler is: ${CMAKE_C_COMPILER_ID}, version: ${CMAKE_C_COMPILER_VERSION}") IF (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.8.5) - SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation ${GCC_COVERAGE_COMPILE_FLAGS} ${TOOLS_SANITIZE_FLAG}") + SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE -Werror -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation ${GCC_COVERAGE_COMPILE_FLAGS} ${TOOLS_SANITIZE_FLAG}") ELSE () SET(CMAKE_C_FLAGS "-Wall -Wshadow -std=c99 -std=gnu11 -O3 -DRELEASE ${GCC_COVERAGE_COMPILE_FLAGS}") ENDIF () diff --git a/src/benchData.c b/src/benchData.c index 3d9abeea0..5d2902368 100644 --- a/src/benchData.c +++ b/src/benchData.c @@ -450,7 +450,7 @@ static int generateRandDataSQL(SSuperTable *stbInfo, char *sampleDataBuf, continue; } - int n; + int n = 0; if (field->null) { n = snprintf(sampleDataBuf + pos, bufLen - pos, "null,"); if (n < 0 || n >= bufLen - pos) { @@ -616,7 +616,7 @@ static int generateRandDataStmt( int fieldsSize = fields->size; for (int i = 0; i < fieldsSize; ++i) { Field * field = benchArrayGet(fields, i); - int n; + int n = 0; switch (field->type) { case TSDB_DATA_TYPE_BOOL: { bool rand_bool = (taosRandom() % 2) & 1; @@ -764,7 +764,7 @@ static int generateRandDataSmlTelnet(SSuperTable *stbInfo, char *sampleDataBuf, } for (int i = 0; i < fieldsSize; ++i) { Field * field = benchArrayGet(fields, i); - int n; + int n = 0; switch (field->type) { case TSDB_DATA_TYPE_BOOL: { bool rand_bool = (taosRandom() % 2) & 1;