Skip to content

Commit

Permalink
dtls.c: fix formatting of GET_VAR_FIELD.
Browse files Browse the repository at this point in the history
Signed-off-by: Achim Kraus <[email protected]>
  • Loading branch information
boaks committed May 13, 2024
1 parent 42732c4 commit 802e137
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 802e137

Please sign in to comment.