security: reject unknown tags in message_get to prevent va_arg desync

The switch in message_get had no default case. An unrecognized tag byte
from a malicious client would skip the switch body without consuming
the va_arg parameter, desynchronizing all subsequent argument reads
and causing undefined behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-30 09:14:08 +02:00
parent d4a1278018
commit 0ae17566f2

View file

@ -361,6 +361,8 @@ int message_get(struct message *m, ...)
if ((res = read_format_info(m, va_arg(va, struct format_info*))) < 0) if ((res = read_format_info(m, va_arg(va, struct format_info*))) < 0)
goto done; goto done;
break; break;
default:
goto invalid;
} }
} }
res = 0; res = 0;