mirror of
https://github.com/eclipse/tinydtls.git
synced 2025-10-14 03:10:09 +08:00
dtls.c: fix formatting of GET_VAR_FIELD.
Signed-off-by: Achim Kraus <achim.kraus@cloudcoap.net>
This commit is contained in:
24
dtls.c
24
dtls.c
@@ -240,18 +240,18 @@ memarray_t dtlscontext_storage;
|
||||
* \param A alert description in case of a length violation
|
||||
* \param M logging message in case of a length violation
|
||||
*/
|
||||
#define GET_VAR_FIELD(VL, P, L, T, A, M) { \
|
||||
if (L < sizeof(T)) { \
|
||||
dtls_info("%s: field length exceeds buffer", M); \
|
||||
return dtls_alert_fatal_create(A); \
|
||||
} \
|
||||
VL = dtls_ ## T ## _to_int(P); \
|
||||
L -= sizeof(T); \
|
||||
P += sizeof(T); \
|
||||
if (L < VL) { \
|
||||
dtls_info("%s: field value exceeds buffer", M); \
|
||||
return dtls_alert_fatal_create(A); \
|
||||
} \
|
||||
#define GET_VAR_FIELD(VL, P, L, T, A, M) { \
|
||||
if (L < sizeof(T)) { \
|
||||
dtls_info("%s: field length exceeds buffer", M); \
|
||||
return dtls_alert_fatal_create(A); \
|
||||
} \
|
||||
VL = dtls_ ## T ## _to_int(P); \
|
||||
L -= sizeof(T); \
|
||||
P += sizeof(T); \
|
||||
if (L < VL) { \
|
||||
dtls_info("%s: field value exceeds buffer", M); \
|
||||
return dtls_alert_fatal_create(A); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* some constants for the PRF */
|
||||
|
Reference in New Issue
Block a user