oui_info_len is an int from a marshaled client message. Without a
sanity check, a negative or huge value drove malloc()/memcpy().
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
{
struct lldpd_custom *custom;
+ if (curr->oui_info_len < 0 ||
+ curr->oui_info_len > LLDP_TLV_ORG_OUI_INFO_MAXLEN) {
+ log_warnx("rpc", "invalid custom TLV info length: %d",
+ curr->oui_info_len);
+ return;
+ }
if ((custom = malloc(sizeof(struct lldpd_custom)))) {
memcpy(custom, curr, sizeof(struct lldpd_custom));
if ((custom->oui_info = malloc(custom->oui_info_len))) {