diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-01-01 21:20:54 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-01-01 21:33:18 +0100 |
commit | 552989ad5762e051eb1a758bc61d8ce1d3c5e009 (patch) | |
tree | 4a2fcad07ef4917b77f6956a8a9338827832f30a /src/common | |
parent | 222a6a5e23a64b42f3ba1e2d80b425b11d3d36c0 (diff) |
common: Fix faulty memcpy statement in the paging code
This was experienced by Daniel on his 64bit machine. The paging
expiration time was too high and not set by the code at all. Using
gdb watchpoints he found the place where the memory is written. The
issue is that the size of the pointer (8) and not the size of the
data structure was copied (3).
Fix the issue by assigning the de-referenced value. gcc generates
the same code as if we had written:
memcpy(&ps->chan_desc, chan_desc, sizeof(*chan_desc));
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/paging.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/paging.c b/src/common/paging.c index e6c1e6b9..d7c22610 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -499,7 +499,7 @@ int paging_si_update(struct paging_state *ps, struct gsm48_control_channel_descr { LOGP(DPAG, LOGL_INFO, "Paging SI update\n"); - memcpy(&ps->chan_desc, chan_desc, sizeof(chan_desc)); + ps->chan_desc = *chan_desc; /* FIXME: do we need to re-sort the old paging_records? */ |