Kamailio itself also discovers the faulty header value when and if it grows above the allowed integer size. In this example it even concatenated the value 3 times:
2022-11-03 13:42:58 | 28(53) ERROR: {Thu Nov 3 12:42:58 2022 1 17733 INVITE 9326c0d2-2653-4041-8977-eecf1827a79c} <core> [core/parser/msg_parser.c:340]: parse_headers(): bad header field [**Content-Length: 129712971297**Show context -- | -- | | 2022-11-03 13:42:58 | 28(53) DEBUG: {Thu Nov 3 12:42:58 2022 1 17733 INVITE 9326c0d2-2653-4041-8977-eecf1827a79c} <core> [core/parser/msg_parser.c:281]: get_hdr_field(): error exit | | 2022-11-03 13:42:58 | 28(53) ERROR: {Thu Nov 3 12:42:58 2022 1 17733 INVITE 9326c0d2-2653-4041-8977-eecf1827a79c} <core> [core/parser/msg_parser.c:182]: get_hdr_field(): bad content_length header | | 2022-11-03 13:42:58 | 28(53) ERROR: {Thu Nov 3 12:42:58 2022 1 17733 INVITE 9326c0d2-2653-4041-8977-eecf1827a79c} <core> [core/parser/parse_content.c:276]: parse_content_length(): parse error near char [57][9] | | 2022-11-03 13:42:58 | 28(53) ERROR: {Thu Nov 3 12:42:58 2022 1 17733 INVITE 9326c0d2-2653-4041-8977-eecf1827a79c} <core> [core/parser/parse_content.c:237]: parse_content_length(): content **lenght** value is too large