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

laforge gerrit-no-reply at lists.osmocom.org
Sun Jul 21 06:10:04 UTC 2019


laforge has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/49/14849/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190721/22076f1a/attachment.html>


More information about the gerrit-log mailing list