diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-12-17 18:19:19 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-12-18 11:12:16 +0000 |
commit | 8fef761d14585e92528eda6cdb2a7b31154bcc70 (patch) | |
tree | a0188f8436aa58afb208e83245b70b12daf7d3e1 /src | |
parent | 475a0acc64efb4b3de47d2f234eb67886a4fa7fe (diff) |
fix strncpy bug in gprs_ns2_fr_bind()
This use of strncpy() fails to account for the terminating nul
character. Use OSMO_STRLCPY_ARRAY() instead.
(Interestingly my compiler doesn't complain about this one, though it
failed on another similar use of strncpy().)
Change-Id: Id53e940c7a39ab154966548f4173a179c5bc9151
Diffstat (limited to 'src')
-rw-r--r-- | src/gb/gprs_ns2_fr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c index 1ff80ed0..782e5a36 100644 --- a/src/gb/gprs_ns2_fr.c +++ b/src/gb/gprs_ns2_fr.c @@ -497,7 +497,7 @@ int gprs_ns2_fr_bind(struct gprs_ns2_inst *nsi, rc = -EINVAL; goto err_priv; } - strncpy(priv->netif, netif, sizeof(priv->netif)); + OSMO_STRLCPY_ARRAY(priv->netif, netif); if (result) *result = bind; |