diff options
| author | khedor <khedor@gmail.com> | 2026-05-22 20:14:57 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-23 11:41:36 +0300 |
| commit | 4823556fbbadcd5205175d423ebca627dc317843 (patch) | |
| tree | fbb82d07046f499ae272294150c0b41658f126b4 /accel-pppd/cli/std_cmd.c | |
| parent | 22c61e8e2e16ebe8e9576fe46487e3614982e8ac (diff) | |
| download | accel-ppp-4823556fbbadcd5205175d423ebca627dc317843.tar.gz accel-ppp-4823556fbbadcd5205175d423ebca627dc317843.zip | |
pppoe/disc: fix init_net allocation size
In init_net(), the buffer for struct disc_net was sized as
n = _malloc(sizeof(*net) + (HASH_BITS + 1) * sizeof(struct tree));
but 'net' is the const struct ap_net * argument, not the disc_net being
allocated. sizeof(*net) is therefore sizeof(struct ap_net), which is
substantially smaller than sizeof(struct disc_net). Every field of *n
written past the ap_net-sized prefix (ctx, hnd, net, refs, etc.) lands
in unallocated heap memory.
Use sizeof(*n) so the allocation matches the actual destination type.
Signed-off-by: khedor <khedor@gmail.com>
Diffstat (limited to 'accel-pppd/cli/std_cmd.c')
0 files changed, 0 insertions, 0 deletions
