Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10178


Change subject: fix strncpy bug in rs232.c
......................................................................

fix strncpy bug in rs232.c

Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483
---
M src/rs232.c
1 file changed, 1 insertion(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/78/10178/1

diff --git a/src/rs232.c b/src/rs232.c
index da5b56b..28f1ba0 100644
--- a/src/rs232.c
+++ b/src/rs232.c
@@ -141,8 +141,7 @@

 void osmo_rs232_set_serial_port(struct osmo_rs232 *r, char *serial_port)
 {
-       strncpy(r->cfg.serial_port, serial_port, PATH_MAX);
-       r->cfg.serial_port[PATH_MAX-1] = '\0';
+       osmo_strlcpy(r->cfg.serial_port, serial_port, PATH_MAX);
 }
 
 void osmo_rs232_set_baudrate(struct osmo_rs232 *r, int baudrate)

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

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483
Gerrit-Change-Number: 10178
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <[email protected]>

Reply via email to