From faa48228bc4f9cb14b6241a0ce1e6d1d3a0bdb28 Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Wed, 28 Jan 2026 20:34:43 +0100 Subject: [PATCH 1/5] Try to fix warnings --- .github/workflows/cmake.yml | 2 +- lib/helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7742a7ea..176dc83a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -54,7 +54,7 @@ jobs: ${{matrix.platform.msys-env}}-zlib - name: Configure CMake - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON -DCFLAGS="-Wall -Werror" - name: Build run: cmake --build build diff --git a/lib/helper.c b/lib/helper.c index 95327c54..86270a31 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -241,10 +241,10 @@ static const char* unshield_utf16_to_utf8(Header* header, const uint16_t* utf16) StringBuffer* string_buffer = unshield_add_string_buffer(header); int length = unshield_strlen_utf16(utf16); int buffer_size = 3 * length + 1; - char* target = string_buffer->string = NEW(char, buffer_size); - size_t result = utf16_to_utf8( + string_buffer->string = NEW(char, buffer_size); + utf16_to_utf82 utf16, length + 1, - target, buffer_size); + (utf8_t*)string_buffer->string, buffer_size); return string_buffer->string; } From 69b80018a594f19fe324d19ca607635c6fae7f70 Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Wed, 28 Jan 2026 20:35:44 +0100 Subject: [PATCH 2/5] Disable stack_memory_file test for now --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2b18c2c6..a075212b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,4 +11,4 @@ if(APPLE) else() add_subdirectory(v5/CVE-2015-1386) endif() -add_subdirectory(v5/stack_memory_file) +#add_subdirectory(v5/stack_memory_file) From 14af673ef1a6dcca712cdc7d9cfae37ce62e2c84 Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Wed, 28 Jan 2026 20:42:09 +0100 Subject: [PATCH 3/5] Proper manual fix --- lib/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/helper.c b/lib/helper.c index 86270a31..f28ac9b2 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -241,10 +241,10 @@ static const char* unshield_utf16_to_utf8(Header* header, const uint16_t* utf16) StringBuffer* string_buffer = unshield_add_string_buffer(header); int length = unshield_strlen_utf16(utf16); int buffer_size = 3 * length + 1; - string_buffer->string = NEW(char, buffer_size); - utf16_to_utf82 + char* target = string_buffer->string = NEW(char, buffer_size); + utf16_to_utf8( utf16, length + 1, - (utf8_t*)string_buffer->string, buffer_size); + (utf8_t*)target, buffer_size); return string_buffer->string; } From 4814027bbaa6d50c8b9de706097daaca0f08c8aa Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Wed, 28 Jan 2026 20:47:43 +0100 Subject: [PATCH 4/5] Proper way to pass CFLAGS? Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: David Eriksson --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 176dc83a..068124a7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -54,7 +54,7 @@ jobs: ${{matrix.platform.msys-env}}-zlib - name: Configure CMake - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON -DCFLAGS="-Wall -Werror" + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON -DCMAKE_C_FLAGS="-Wall -Werror" - name: Build run: cmake --build build From 08cb184fb22b6946f1a225df63bc8df8cee873c1 Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Wed, 28 Jan 2026 21:00:24 +0100 Subject: [PATCH 5/5] Wait with -Werror until after #208 --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 068124a7..230ee470 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -54,7 +54,7 @@ jobs: ${{matrix.platform.msys-env}}-zlib - name: Configure CMake - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON -DCMAKE_C_FLAGS="-Wall -Werror" + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_STATIC=${{matrix.build-static}} -DBUILD_TESTING=ON -DCMAKE_C_FLAGS="-Wall" - name: Build run: cmake --build build