Skip to content

curl_setup.h: fix dangling pointer in Unicode CURL_DUMP_MODULE_PATHS() (Windows) - #23512

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:w-gcc-u-warning
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:w-gcc-u-warning

Conversation

@vszakats

@vszakats vszakats commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Seen in gcc-16 builds:

lib/curl_setup.h:1109:7: error: using dangling pointer 'path' to 'buffer' [-Werror=dangling-pointer=]
 1109 |       (printf_f)("%s\n", path);                                        \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
src/tool_main.c:165:5: note: in expansion of macro 'CURL_DUMP_MODULE_PATHS'
  165 |     CURL_DUMP_MODULE_PATHS(curl_mprintf);
      |     ^~~~~~~~~~~~~~~~~~~~~~
lib/curl_setup.h:1101:14: note: 'buffer' declared here
 1101 |         char buffer[sizeof(mod.szExePath) * 2];                        \
      |              ^~~~~~

Ref: https://github.com/curl/curl-for-win/actions/runs/39414254864/job/118599289585#step:3:6116

Passes in curl-for-win dev CI (combination not build-tested in curl CI):
https://github.com/curl/curl-for-win/actions/runs/39441902215/job/118693711790

Follow-up to 780405b #23416


Tested OK in curl-for-win: https://github.com/curl/curl-for-win/actions/runs/39441902215/job/118693711790
with commit:
curl/curl-for-win@4c7eefc

…()` (Windows)

Seen in gcc-16 builds:
```
lib/curl_setup.h:1109:7: error: using dangling pointer 'path' to 'buffer' [-Werror=dangling-pointer=]
 1109 |       (printf_f)("%s\n", path);                                        \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
src/tool_main.c:165:5: note: in expansion of macro 'CURL_DUMP_MODULE_PATHS'
  165 |     CURL_DUMP_MODULE_PATHS(curl_mprintf);
      |     ^~~~~~~~~~~~~~~~~~~~~~
lib/curl_setup.h:1101:14: note: 'buffer' declared here
 1101 |         char buffer[sizeof(mod.szExePath) * 2];                        \
      |              ^~~~~~
src/tool_main.c:165:5: note: in expansion of macro 'CURL_DUMP_MODULE_PATHS'
  165 |     CURL_DUMP_MODULE_PATHS(curl_mprintf);
      |     ^~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl-for-win/actions/runs/39414254864/job/118599289585#step:3:6116

Follow-up to 780405b curl#23416
@vszakats vszakats added build cmdline tool tests Windows Windows-specific Unicode Unicode, code page, character encoding labels Oct 20, 2026
@vszakats

Copy link
Copy Markdown
Member Author

Test failures are unrelated.

@vszakats vszakats closed this in 8f143e8 Oct 20, 2026
@vszakats
vszakats deleted the w-gcc-u-warning branch October 20, 2026 15:38
@testclutch

Copy link
Copy Markdown

Analysis of PR #23512 at 44538741:

Test 3236 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 752 different CI jobs (the link just goes to one of them).

Test 3235 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 164 different CI jobs (the link just goes to one of them).

Generated by Testclutch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build cmdline tool tests Unicode Unicode, code page, character encoding Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants