[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 211/411: strerror: fix null deref on winapi out-of-memory
From: |
gnunet |
Subject: |
[gnurl] 211/411: strerror: fix null deref on winapi out-of-memory |
Date: |
Wed, 13 Jan 2021 01:20:26 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 9a13f7c2a7ca5fca99622a6feeb29abc3b05d713
Author: Jay Satiro <raysatiro@yahoo.com>
AuthorDate: Thu Oct 1 13:34:59 2020 -0400
strerror: fix null deref on winapi out-of-memory
Follow-up to bed5f84 from several days ago.
Ref: https://github.com/curl/curl/pull/6005
---
lib/strerror.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/strerror.c b/lib/strerror.c
index fef5c2bca..0a3b73844 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -670,9 +670,11 @@ get_winapi_error(int err, char *buf, size_t buflen)
FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err,
LANG_NEUTRAL, wbuf, sizeof(wbuf)/sizeof(TCHAR), NULL)) {
char *msg = curlx_convert_tchar_to_UTF8(wbuf);
- strncpy(buf, msg, buflen - 1);
- buf[buflen-1] = '\0';
- curlx_unicodefree(msg);
+ if(msg) {
+ strncpy(buf, msg, buflen - 1);
+ buf[buflen-1] = '\0';
+ curlx_unicodefree(msg);
+ }
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 208/411: TODO: Add OpenBSD libtool notice, (continued)
- [gnurl] 208/411: TODO: Add OpenBSD libtool notice, gnunet, 2021/01/12
- [gnurl] 209/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 213/411: tool_setopt: escape binary data to hex, not octal, gnunet, 2021/01/12
- [gnurl] 260/411: curl_url_set.3: fix typo in the RETURN VALUE section, gnunet, 2021/01/12
- [gnurl] 234/411: tests/server/util.c: fix support for Windows Unicode builds, gnunet, 2021/01/12
- [gnurl] 235/411: CI/tests: fix invocation of tests for CMake builds, gnunet, 2021/01/12
- [gnurl] 227/411: checksrc: detect // comments on column 0, gnunet, 2021/01/12
- [gnurl] 199/411: sectransp: make it build with --disable-proxy, gnunet, 2021/01/12
- [gnurl] 246/411: runtests: return error if no tests ran, gnunet, 2021/01/12
- [gnurl] 228/411: runtests.pl: use $LIBDIR variable instead of hardcoded path, gnunet, 2021/01/12
- [gnurl] 211/411: strerror: fix null deref on winapi out-of-memory,
gnunet <=
- [gnurl] 237/411: mailmap: fixups of some contributors, gnunet, 2021/01/12
- [gnurl] 204/411: examples/README: convert to markdown, gnunet, 2021/01/12
- [gnurl] 252/411: http3: fix two build errors, silence warnings, gnunet, 2021/01/12
- [gnurl] 191/411: schannel: return CURLE_PEER_FAILED_VERIFICATION for untrusted root, gnunet, 2021/01/12
- [gnurl] 264/411: CMake: call the feature unixsockets without dash, gnunet, 2021/01/12
- [gnurl] 207/411: tests/unit/README: convert to markdown, gnunet, 2021/01/12
- [gnurl] 261/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 215/411: test1465: verify --libcurl with binary POST data, gnunet, 2021/01/12
- [gnurl] 192/411: ROADMAP: updates and cleanups, gnunet, 2021/01/12
- [gnurl] 242/411: RELEASE-NOTES: synced, gnunet, 2021/01/12