async.[ch]: Fix flexible array member 'token' warning

Make token[] token[8] as the maximum size of a token is 8 bytes

Check that we do not overflow coap_async_state_t when copying in
the token.
This commit is contained in:
Jon Shallow committed 2018-05-22 11:32:58 +01:00
1 parent 856236dc6c
commit a17757ec6e
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ typedef struct coap_async_state_t {
coap_tid_t id; /**< transaction id */
struct coap_async_state_t *next; /**< internally used for linking */
size_t tokenlen; /**< length of the token */
unsigned char token[]; /**< the token to use in a response */
uint8_t token[8]; /**< the token to use in a response */
} coap_async_state_t;
/* Definitions for Async Status Flags These flags can be used to control the