mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +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
|
||||
}
|
||||
|
||||
assert(*rxsize >= rcmd->rxlen);
|
||||
*rxsize = rcmd->rxlen;
|
||||
if (rxsize) {
|
||||
assert(*rxsize >= rcmd->rxlen);
|
||||
*rxsize = rcmd->rxlen;
|
||||
|
||||
if (rxsize && *rxsize && rcmd->rxbuf)
|
||||
memcpy(rxbuf, epic->rxbuf.bfr, *rxsize);
|
||||
if (*rxsize && rcmd->rxbuf)
|
||||
memcpy(rxbuf, epic->rxbuf.bfr, *rxsize);
|
||||
}
|
||||
|
||||
afk_epic_rx_ack(epic);
|
||||
|
||||
|
|
Loading…
Reference in a new issue