Language: C
Label: safe
CWE: CWE-787 \u2014 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.

Code:
ahcp_time_print(netdissect_options *ndo,
                const u_char *cp, uint8_t len)
{
	time_t t;
	char buf[sizeof("-yyyyyyyyyy-mm-dd hh:mm:ss UTC")];

	if (len != 4)
		goto invalid;
	t = GET_BE_U_4(cp);
	ND_PRINT(": %s",
	    nd_format_time(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S UTC",
	      gmtime(&t)));
	return;

invalid:
	nd_print_invalid(ndo);
	ND_TCHECK_LEN(cp, len);
}