[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 213/256: curl: check fseek() return code and bail o
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 213/256: curl: check fseek() return code and bail on error |
Date: |
Fri, 06 Oct 2017 19:45:04 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 299896ca0963a79d5ec4de8ca83922c48f16f1bb
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Sep 20 12:03:44 2017 +0200
curl: check fseek() return code and bail on error
Detected by coverity. CID 1418137.
---
src/tool_operate.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/tool_operate.c b/src/tool_operate.c
index f32558af5..6dd05dbf4 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1668,6 +1668,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
retry_sleep = RETRY_SLEEP_MAX;
}
if(outs.bytes && outs.filename && outs.stream) {
+ int rc;
/* We have written data to a output file, we truncate file
*/
if(!global->mute)
@@ -1688,14 +1689,21 @@ static CURLcode operate_do(struct GlobalConfig *global,
}
/* now seek to the end of the file, the position where we
just truncated the file in a large file-safe way */
- fseek(outs.stream, 0, SEEK_END);
+ rc = fseek(outs.stream, 0, SEEK_END);
#else
/* ftruncate is not available, so just reposition the file
to the location we would have truncated it. This won't
work properly with large files on 32-bit systems, but
most of those will have ftruncate. */
- fseek(outs.stream, (long)outs.init, SEEK_SET);
+ rc = fseek(outs.stream, (long)outs.init, SEEK_SET);
#endif
+ if(rc) {
+ if(!global->mute)
+ fprintf(global->errors,
+ "failed seeking to end of file, exiting\n");
+ result = CURLE_WRITE_ERROR;
+ goto quit_urls;
+ }
outs.bytes = 0; /* clear for next round */
}
continue; /* curl_easy_perform loop */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 29/256: CURL_SIZEOF_LONG: removed, use only SIZEOF_LONG, (continued)
- [GNUnet-SVN] [gnurl] 29/256: CURL_SIZEOF_LONG: removed, use only SIZEOF_LONG, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 163/256: mime: drop internal FILE * support., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 145/256: curl.h: fix "unused checksrc ignore", remove dangling reference, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 159/256: mime: fix a trivial warning., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 220/256: tests: make the imap server not verify user+password, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 210/256: cookies: use lock when using CURLINFO_COOKIELIST, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 208/256: mime:escape_string minor clarification change, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 160/256: openssl: Integrate Peter Wu's SSLKEYLOGFILE implementation, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 177/256: configure: use -Wno-varargs on clang 3.9[.X] debug builds, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 172/256: KNOWN_BUGS: Remove CMake symbol hiding issue, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 213/256: curl: check fseek() return code and bail on error,
gnunet <=
- [GNUnet-SVN] [gnurl] 120/256: non-ascii: allow conversion functions to be called with a NULL data handle., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 244/256: libcurl-tutorial: fix two typos., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 205/256: travis: on mac, don't install openssl or libidn, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 247/256: test1153: verify quoted double-qoutes in PWD response, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 228/256: ntlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 142/256: schannel: return CURLE_SSL_CACERT on failed verification, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 122/256: runtests.pl: Apply strippart to upload too., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 180/256: travis: add build without HTTP/SMTP/IMAP, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 113/256: unit1301: fix error message on first test, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 214/256: mime: fix an explicit null dereference (#1899), gnunet, 2017/10/06