[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 61/254: failf: use private buffer, don't clobber re
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 61/254: failf: use private buffer, don't clobber receive buffer |
Date: |
Sat, 17 Jun 2017 16:51:33 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit f2fadf490f66ad364f5a6f0356d626dda5f9a82f
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Apr 25 00:50:21 2017 +0200
failf: use private buffer, don't clobber receive buffer
---
lib/sendf.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/lib/sendf.c b/lib/sendf.c
index 84b6b4b2f..a7b33c286 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -243,21 +243,20 @@ void Curl_failf(struct Curl_easy *data, const char *fmt,
...)
{
va_list ap;
size_t len;
+ char error[CURL_ERROR_SIZE + 2];
va_start(ap, fmt);
- vsnprintf(data->state.buffer, BUFSIZE, fmt, ap);
+ vsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
+ len = strlen(error);
if(data->set.errorbuffer && !data->state.errorbuf) {
- snprintf(data->set.errorbuffer, CURL_ERROR_SIZE, "%s", data->state.buffer);
+ strcpy(data->set.errorbuffer, error);
data->state.errorbuf = TRUE; /* wrote error string */
}
if(data->set.verbose) {
- len = strlen(data->state.buffer);
- if(len < BUFSIZE - 1) {
- data->state.buffer[len] = '\n';
- data->state.buffer[++len] = '\0';
- }
- Curl_debug(data, CURLINFO_TEXT, data->state.buffer, len, NULL);
+ error[len] = '\n';
+ error[++len] = '\0';
+ Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
}
va_end(ap);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 89/254: tests/server: make string literals const, (continued)
- [GNUnet-SVN] [gnurl] 89/254: tests/server: make string literals const, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 37/254: runtests.pl: support multiline <postcheck> commands, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 75/254: curl: non-boolean command line args reject --no- prefixes, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 52/254: anyauthput: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 39/254: url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 108/254: test537: use correct variable type, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 103/254: buildconf: fix hang on IRIX, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 30/254: lib: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 102/254: opts: fix bad example formatting \n => \\n, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 86/254: curl: fix warning "comma at end of enumerator list", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 61/254: failf: use private buffer, don't clobber receive buffer,
gnunet <=
- [GNUnet-SVN] [gnurl] 92/254: runtests: use -R for random order, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 71/254: url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 42/254: unit1604: fixed compilation under Windows, broken in the previous commit, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 38/254: tests: added --remote-time tests for remaining protocols that support it, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 41/254: tests: fixed OOM handling of unit tests to abort test, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 55/254: CURLOPT_BUFFERSIZE: 1024 bytes is now the minimum size, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 57/254: buffer_size: make sure it always has the correct size, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 105/254: asyn-thread: fix unused macro warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 73/254: gtls: fixed a lingering BUFSIZE reference, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 70/254: BUFSIZE: rename to READBUFFER_*, make separate MASTERBUF_SIZE, gnunet, 2017/06/17