From b7344d08df34521c05d597fd0776f93204b78bac Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 12 Apr 2019 21:48:07 +0700 Subject: [PATCH] gb/gprs_ns_sns.c: fix incorrect sizeof() calculation Calling sizeof() on a pointer would result in getting size of the pointer (usually 4 or 8 bytes) itself, but not the size of the memory it points to. Change-Id: I83f55a9638b75d9097d37992f7c84707791f10f6 Fixes: CID#194266 --- src/gb/gprs_ns_sns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gb/gprs_ns_sns.c b/src/gb/gprs_ns_sns.c index dd8d3a2dc..aa8b121ae 100644 --- a/src/gb/gprs_ns_sns.c +++ b/src/gb/gprs_ns_sns.c @@ -498,7 +498,7 @@ static void gprs_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, voi } /* make a copy as do_sns_delete() will change the array underneath us */ ip4_remote = talloc_memdup(fi, gss->ip4_remote, - gss->num_ip4_remote*sizeof(v4_list)); + gss->num_ip4_remote*sizeof(*v4_list)); for (i = 0; i < gss->num_ip4_remote; i++) { if (ip4_remote[i].ip_addr == ip_addr) { rc = do_sns_delete(fi, &ip4_remote[i]);