Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned. MFC after: 3 days
This commit is contained in:
parent
7c39d98bd3
commit
7fcdc815d2
@ -574,7 +574,7 @@ bnep_recv_filter_multi_addr_rsp(channel_t *chan, uint8_t *ptr, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
bnep_send_control(channel_t *chan, uint8_t type, ...)
|
bnep_send_control(channel_t *chan, unsigned type, ...)
|
||||||
{
|
{
|
||||||
packet_t *pkt;
|
packet_t *pkt;
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
@ -590,7 +590,7 @@ bnep_send_control(channel_t *chan, uint8_t type, ...)
|
|||||||
va_start(ap, type);
|
va_start(ap, type);
|
||||||
|
|
||||||
*p++ = BNEP_CONTROL;
|
*p++ = BNEP_CONTROL;
|
||||||
*p++ = type;
|
*p++ = (uint8_t)type;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD:
|
case BNEP_CONTROL_COMMAND_NOT_UNDERSTOOD:
|
||||||
|
@ -183,7 +183,7 @@ b2eaddr(void *dst, bdaddr_t *src)
|
|||||||
/* bnep.c */
|
/* bnep.c */
|
||||||
bool bnep_send(channel_t *, packet_t *);
|
bool bnep_send(channel_t *, packet_t *);
|
||||||
bool bnep_recv(packet_t *);
|
bool bnep_recv(packet_t *);
|
||||||
void bnep_send_control(channel_t *, uint8_t, ...);
|
void bnep_send_control(channel_t *, unsigned, ...);
|
||||||
|
|
||||||
/* channel.c */
|
/* channel.c */
|
||||||
void channel_init(void);
|
void channel_init(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user