mirror of
https://github.com/AsahiLinux/m1n1
synced 2025-02-16 21:58:27 +00:00
afk: Fix a NULL pointer dereference in adfk_epic_send()
Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
parent
76fbc77ad2
commit
a4c4b8cd99
1 changed files with 6 additions and 4 deletions
10
src/afk.c
10
src/afk.c
|
@ -479,11 +479,13 @@ int afk_epic_command(afk_epic_ep_t *epic, int channel, u16 sub_type, void *txbuf
|
||||||
return rcmd->retcode; // should be negative already
|
return rcmd->retcode; // should be negative already
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(*rxsize >= rcmd->rxlen);
|
if (rxsize) {
|
||||||
*rxsize = rcmd->rxlen;
|
assert(*rxsize >= rcmd->rxlen);
|
||||||
|
*rxsize = rcmd->rxlen;
|
||||||
|
|
||||||
if (rxsize && *rxsize && rcmd->rxbuf)
|
if (*rxsize && rcmd->rxbuf)
|
||||||
memcpy(rxbuf, epic->rxbuf.bfr, *rxsize);
|
memcpy(rxbuf, epic->rxbuf.bfr, *rxsize);
|
||||||
|
}
|
||||||
|
|
||||||
afk_epic_rx_ack(epic);
|
afk_epic_rx_ack(epic);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue