mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
4f619c202c
commit
b7344d08df
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue