aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/smpp_openbsc.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-05 12:57:06 +0100
committerMax <msuraev@sysmocom.de>2018-02-05 12:57:06 +0100
commit98f7467ac8ba53230d4ae6167aa5664a105323b3 (patch)
tree2beb1d76dce3353b57d31ae9303254ad6e22465d /src/libmsc/smpp_openbsc.c
parentc2007855cebd240cf2868ce0d2dd90ba42ddfa8a (diff)
Wrap osmo_strlcpy() calls
Using following semantic patch: @@ expression A, B, C; @@ - osmo_strlcpy(A, B, sizeof(A)); + OSMO_STRLCPY_ARRAY(A, B); Which was applied using following command: spatch --dir src -I src --sp-file strlcpy.spatch --in-place --recursive-includes All the calls to osmo_strlcpy() which use destination buffer obtained via sizeof() were replaced with the corresponding wrapper macro. Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Related: OS#2864
Diffstat (limited to 'src/libmsc/smpp_openbsc.c')
-rw-r--r--src/libmsc/smpp_openbsc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c
index b0469f929..c12db5f3e 100644
--- a/src/libmsc/smpp_openbsc.c
+++ b/src/libmsc/smpp_openbsc.c
@@ -152,16 +152,15 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
sms->dst.ton = submit->dest_addr_ton;
sms->dst.npi = submit->dest_addr_npi;
if (dest)
- osmo_strlcpy(sms->dst.addr, dest->msisdn, sizeof(sms->dst.addr));
+ OSMO_STRLCPY_ARRAY(sms->dst.addr, dest->msisdn);
else
- osmo_strlcpy(sms->dst.addr, (const char *)submit->destination_addr,
- sizeof(sms->dst.addr));
+ OSMO_STRLCPY_ARRAY(sms->dst.addr,
+ (const char *)submit->destination_addr);
/* fill in the source address */
sms->src.ton = submit->source_addr_ton;
sms->src.npi = submit->source_addr_npi;
- osmo_strlcpy(sms->src.addr, (char *)submit->source_addr,
- sizeof(sms->src.addr));
+ OSMO_STRLCPY_ARRAY(sms->src.addr, (char *)submit->source_addr);
if (submit->esm_class == SMPP34_DELIVERY_ACK)
sms->is_report = true;