summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-05-01 22:13:03 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-05-04 16:36:10 -0400
commit77c2883da976872362780ba4f774a52f9dd07ad2 (patch)
tree5cbdf9f997e7d6de3abce4a8fddf884ff35193b6
parent84db583e3e78e82fe8092dce1aa16a8b60a52fcd (diff)
downloadlighttpd1.4-77c2883da976872362780ba4f774a52f9dd07ad2.tar.gz
lighttpd1.4-77c2883da976872362780ba4f774a52f9dd07ad2.zip
[mod_webdav] quiet coverity warnings
-rw-r--r--src/mod_webdav.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index aadf6897..60288d4e 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -2034,6 +2034,9 @@ __attribute_noinline__
static int
webdav_fcopyfile_sz (int ifd, int ofd, off_t isz)
{
+ if (0 == isz)
+ return 0;
+
#ifdef _WIN32
/* Windows CopyFile() not usable here; operates on filenames, not fds */
#else
@@ -2046,8 +2049,8 @@ webdav_fcopyfile_sz (int ifd, int ofd, off_t isz)
if (0 == fcopyfile(ifd, ofd, NULL, COPYFILE_ALL))
return 0;
- lseek(ifd, 0, SEEK_SET);
- lseek(ofd, 0, SEEK_SET);
+ if (0 != lseek(ifd, 0, SEEK_SET)) return -1;
+ if (0 != lseek(ofd, 0, SEEK_SET)) return -1;
#endif
#if 0
@@ -2055,8 +2058,8 @@ webdav_fcopyfile_sz (int ifd, int ofd, off_t isz)
if (0 == elftc_copyfile(ifd, ofd))
return 0;
- lseek(ifd, 0, SEEK_SET);
- lseek(ofd, 0, SEEK_SET);
+ if (0 != lseek(ifd, 0, SEEK_SET)) return -1;
+ if (0 != lseek(ofd, 0, SEEK_SET)) return -1;
#endif
#endif
@@ -2067,12 +2070,9 @@ webdav_fcopyfile_sz (int ifd, int ofd, off_t isz)
return 0;
/*lseek(ifd, 0, SEEK_SET);*/ /*(ifd offset not modified due to &offset arg)*/
- lseek(ofd, 0, SEEK_SET);
+ if (0 != lseek(ofd, 0, SEEK_SET)) return -1;
#endif
- if (0 == isz)
- return 0;
-
ssize_t rd, wr, off;
char buf[16384];
do {
@@ -2777,6 +2777,9 @@ webdav_copymove_dir (const plugin_config * const pconf,
* Be sure to hard-link using linkat() w/o AT_SYMLINK_FOLLOW)*/
}
#endif
+ else {
+ status = 0;
+ }
src->path->ptr[ (src->path->used = src_path_used) -1] = '\0';
src->rel_path->ptr[(src->rel_path->used = src_rel_path_used)-1] = '\0';