Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: don't use strerror() #7685

Closed
wants to merge 3 commits into from
Closed

lib: don't use strerror() #7685

wants to merge 3 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Sep 8, 2021

We have and provide Curl_strerror() internally for a reason: strerror()
is not necessarily thread-safe so we should always try to avoid it.

Extended checksrc to warn for this, but feature the check disabled by
default and only enable it in lib/

We have and provide Curl_strerror() internally for a reason: strerror()
is not necessarily thread-safe so we should always try to avoid it.

Extended checksrc to warn for this, but feature the check disabled by
default and only enable it in lib/
@bagder bagder added the tidy-up label Sep 8, 2021
@bagder bagder closed this in 2f0bb86 Sep 9, 2021
@bagder bagder deleted the bagder/avoid-strerror branch September 9, 2021 05:55
jay added a commit to jay/curl that referenced this pull request Sep 17, 2021
- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: curl#7685
Ref: curl@2f0bb86

Closes #xxxx
jay added a commit to jay/curl that referenced this pull request Sep 17, 2021
- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: curl#7685
Ref: curl@2f0bb86

Closes #xxxx
jay added a commit that referenced this pull request Sep 17, 2021
- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: #7685
Ref: 2f0bb86

Closes #7735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

1 participant