Skip to content

krb5: fix socket confusion, MSVC compiler warnings - #15585

Closed
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:krb5-fix
Closed

vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:krb5-fix

Conversation

@vszakats

@vszakats vszakats commented Nov 15, 2024 •

Copy link
Copy Markdown
Member

@github-actions github-actions Bot added the CI Continuous Integration label Nov 15, 2024
@talregev

Copy link
Copy Markdown
Contributor

Thank you for your fix! 🎉
I drop my PR in favor this PR.

@vszakats vszakats changed the title krb5: fix socket/sockindex confusion krb5: fix socket/sockindex confusion and compiler warnings Nov 15, 2024
@vszakats vszakats changed the title krb5: fix socket/sockindex confusion and compiler warnings krb5: fix socket confusion, compiler warnings, add to Windows CI Nov 15, 2024
@vszakats vszakats added the FTP label Nov 15, 2024
@vszakats vszakats changed the title krb5: fix socket confusion, compiler warnings, add to Windows CI krb5: fix socket confusion, MSVC compiler warnings Nov 15, 2024
@testclutch

Copy link
Copy Markdown

Analysis of PR #15585 at 7a430ccc:

Test 3028 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Generated by Testclutch

@vszakats vszakats removed the CI Continuous Integration label Nov 15, 2024
@vszakats vszakats closed this in c41e9cc Nov 15, 2024
vszakats pushed a commit that referenced this pull request Nov 15, 2024
@vszakats
vszakats deleted the krb5-fix branch November 15, 2024 23:13
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
- fix socket/sockindex confusion on writes:

  The callstack used to end with `Curl_write_plain()` accepting a socket
  till 7.87.0. This call got swapped for `Curl_conn_send()`, expecting
  a sockindex. `socket_write()` was updated accordingly. Its callers
  missed it and continued operating on sockets: `do_sec_send()`,
  `sec_write()`, passing it down the stack and `Curl_conn_send()`
  resolving it as if it were a sockindex.
  It affected FTP Kerberos authentication.

  Discovered through MSVC warnings:
  ```
  curl\lib\krb5.c(652,28): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(654,28): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(656,26): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(657,26): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(665,24): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  curl\lib\krb5.c(666,24): warning C4244: 'function': conversion from 'curl_socket_t' to 'int', possible loss of data
  ```
  Ref: https://github.com/curl/curl/actions/runs/11846599621/job/33014592805#step:9:32

  Follow-up to 5651a36 curl#10280
  Bug: curl#15549 (comment)
  Fixes curl#15582

- fix uninitialized buffer:
  ```
  curl\lib\krb5.c(288,1): warning C4701: potentially uninitialized local variable '_gssresp' used
  ```
  Ref: https://github.com/curl/curl/actions/runs/11848626645/job/33020501026?pr=15585#step:9:31

- silence unreachable code compiler warning:
  ```
  curl\lib\krb5.c(370,1): warning C4702: unreachable code
  ```
  Ref: https://github.com/curl/curl/actions/runs/11848626645/job/33020501026?pr=15585#step:9:30

Closes curl#15585
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

int/socket confusion warnings

3 participants