Change in ...osmocom-bb[master]: osmocon: Add missing check for fstat() return value

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 11:00:19 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14854 )

Change subject: osmocon: Add missing check for fstat() return value
......................................................................

osmocon: Add missing check for fstat() return value

Change-Id: Ibef6ee00eb41e16d2ef52931f8c22562090cd1ee
Closes: CID#198570
---
M src/host/osmocon/osmocon.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 1bb0bb7..61672a3 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -287,6 +287,11 @@
 		}
 
 		rc = fstat(fd, &st);
+		if (rc < 0) {
+			perror("fstat");
+			close(fd);
+			return -EIO;
+		}
 		if ((st.st_size > MAX_DNLOAD_SIZE) && (dnload.mode != MODE_ROMLOAD)) {
 			fprintf(stderr, "The maximum file size is 64kBytes (%u bytes)\n",
 				MAX_DNLOAD_SIZE);

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14854
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ibef6ee00eb41e16d2ef52931f8c22562090cd1ee
Gerrit-Change-Number: 14854
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190721/0329b676/attachment.htm>


More information about the gerrit-log mailing list