diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-08-11 13:57:56 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-08-11 12:59:30 +0000 |
commit | d68833cd854b0a47876fea0a180a21c24916c392 (patch) | |
tree | 178029d3631012cbb1a41204665c1ccff9e0fd8b /src/host/layer23/src/mobile/vty_interface.c | |
parent | 272530944609f9daa3ccb803d8b2e8f5b31cd633 (diff) |
layer23: Use osmo_strlcpy() to avoid non-terminated strings
settings.c:191:2: warning: ‘strncpy’ output may be truncated copying 15 bytes from a string of length 15 -Wstringop-truncation]
strncpy(set->imeisv, set->imei, 15);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC subscriber.o
CC support.o
CC transaction.o
CC vty_interface.o
CC voice.o
CC mncc_sock.o
CC primitives.o
mncc_sock.c: In function ‘osmo_unixsock_listen’:
mncc_sock.c:318:2: warning: ‘strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
strncpy(local.sun_path, path, sizeof(local.sun_path));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC script_lua.o
vty_interface.c: In function ‘cfg_gps_device’:
vty_interface.c:1144:2: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
strncpy(g.device, argv[0], sizeof(g.device));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AR libmobile.a
Change-Id: Id52978f3bf7a8abea62237d7c32f8f87e1bb34a1
Diffstat (limited to 'src/host/layer23/src/mobile/vty_interface.c')
-rw-r--r-- | src/host/layer23/src/mobile/vty_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index ec1216ff..4adcf905 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1141,7 +1141,7 @@ DEFUN(cfg_gps_device, cfg_gps_device_cmd, "gps device DEVICE", "GPS receiver\nSelect serial device\n" "Full path of serial device including /dev/") { - strncpy(g.device, argv[0], sizeof(g.device)); + osmo_strlcpy(g.device, argv[0], sizeof(g.device)); g.device[sizeof(g.device) - 1] = '\0'; g.gps_type = GPS_TYPE_SERIAL; if (g.enable) { |