From 5da6fcc0481804a3c7a539c5e925abed9e6f1ab8 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sun, 25 May 2014 19:17:07 +0200 Subject: net: Proper PLMN copy, without null terminating byte Signed-off-by: Paul Kocialkowski --- samsung-ipc/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'samsung-ipc') diff --git a/samsung-ipc/net.c b/samsung-ipc/net.c index 2d04bc8..0597c42 100644 --- a/samsung-ipc/net.c +++ b/samsung-ipc/net.c @@ -41,11 +41,11 @@ int ipc_net_plmn_sel_setup(struct ipc_net_plmn_sel_request_data *data, if (plmn_length > sizeof(data->plmn)) plmn_length = sizeof(data->plmn); - strncpy((char *) data->plmn, plmn, plmn_length); + memcpy((void *) data->plmn, (void *) plmn, plmn_length); // If there are less (5 is the usual case) PLMN bytes, fill the rest with '#' if (plmn_length < sizeof(data->plmn)) - memset(data->plmn + plmn_length, '#', sizeof(data->plmn) - plmn_length); + memset((void *) ((unsigned char *) data->plmn + plmn_length), '#', sizeof(data->plmn) - plmn_length); data->act = act; } -- cgit v1.1