Change in libosmocore[master]: libosmovty: properly initialize vty->fd in vty_new()

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Thu Nov 21 14:56:05 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/16148 )


Change subject: libosmovty: properly initialize vty->fd in vty_new()
......................................................................

libosmovty: properly initialize vty->fd in vty_new()

Since we're using talloc_zero(), vty->fd is initialized with 0,
which corresponds to stdin. Let's set an invalid value to prevent
potential bugs like the one fixed by the recent change [1].

[1] Icdeaea67a06da3a2f07b252e455629559ecc1829

Change-Id: Iec15649781317a23e13d2c2840a8f672050f76c1
---
M src/vty/vty.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/16148/1

diff --git a/src/vty/vty.c b/src/vty/vty.c
index cd252ad..8cc2a3a 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -128,6 +128,7 @@
 		goto out_obuf;
 
 	new->max = VTY_BUFSIZ;
+	new->fd = -1;
 
 	return new;
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iec15649781317a23e13d2c2840a8f672050f76c1
Gerrit-Change-Number: 16148
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191121/d6891825/attachment.htm>


More information about the gerrit-log mailing list