Change in ...osmocom-bb[master]: osmocon: Fix out-of-bounds for partial reads in un_tool_read()

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 10:29:34 UTC 2019


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

Change subject: osmocon: Fix out-of-bounds for partial reads in un_tool_read()
......................................................................

osmocon: Fix out-of-bounds for partial reads in un_tool_read()

"uint8_t buf[4096]; ... &buf + 1" renders an offset of 4096, and not 1!

Change-Id: Ie1407371fe949c3d5746b9fdc32ececc9443692b
Closes: CID#198580
---
M src/host/osmocon/osmocon.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 26416f7..9090d27 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -1242,7 +1242,7 @@
 
 	c = 0;
 	while(c < 2) {
-		rc = read(fd->fd, &buf + c, 2 - c);
+		rc = read(fd->fd, buf + c, 2 - c);
 		if(rc == 0) {
 			// disconnect
 			goto close;
@@ -1262,7 +1262,7 @@
 
 	c = 0;
 	while(c < length) {
-		rc = read(fd->fd, &buf + c, length - c);
+		rc = read(fd->fd, buf + c, length - c);
 		if(rc == 0) {
 			// disconnect
 			goto close;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie1407371fe949c3d5746b9fdc32ececc9443692b
Gerrit-Change-Number: 14849
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/f1f9f8af/attachment.htm>


More information about the gerrit-log mailing list