From: Michael Tremer Date: Tue, 21 Jan 2025 17:32:49 +0000 (+0000) Subject: xfer: Fail if the uploaded file could not be stat'ed X-Git-Tag: 0.9.30~404 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce0473199dc48def2cec6ac8af8445aaa35dca41;p=pakfire.git xfer: Fail if the uploaded file could not be stat'ed Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/xfer.c b/src/pakfire/xfer.c index 9cc8fda2..7949731f 100644 --- a/src/pakfire/xfer.c +++ b/src/pakfire/xfer.c @@ -674,8 +674,8 @@ int pakfire_xfer_set_input(struct pakfire_xfer* xfer, FILE* f) { // Try to find the upload size if (fd > 0) { r = fstat(fd, &stat); - if (r) - return 0; + if (r < 0) + return -errno; // Store the expected filesize xfer->expected_size = stat.st_size;