#define ARG_COUNT_CHECK(_msg, _arg_cnt) do { \
if ((p + _arg_cnt) > end) { \
- fr_strerror_printf("Argument count %u overflows the remaining data in the %s packet", _arg_cnt, _msg); \
+ fr_strerror_printf("Argument count %u overflows the remaining data (%zu) in the %s packet", _arg_cnt, end - p, _msg); \
goto fail; \
} \
p += _arg_cnt; \
if (!arg_cnt) return 0;
if ((p + arg_cnt) > end) {
- fr_strerror_printf("Argument count %u overflows the remaining data in the packet", arg_cnt);
+ fr_strerror_printf("Argument count %u overflows the remaining data (%zu) in the packet", arg_cnt, p - end);
return -1;
}
if ((p + field_len) > end) {
fr_strerror_printf("'%s' length %u overflows the remaining data (%zu) in the packet",
- da->name, field_len, p - end);
+ da->name, field_len, end - p);
return -1;
}