summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pptp/pptp.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.c')
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index 232c9fb5..b323dba6 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -567,6 +567,10 @@ static int pptp_read(struct triton_md_handler_t *h)
log_ppp_error("pptp: invalid magic\n");
goto drop;
}
+ if (ntohs(hdr->length) < sizeof(*hdr)) {
+ log_ppp_error("pptp: message is too short\n");
+ goto drop;
+ }
if (ntohs(hdr->length) >= PPTP_CTRL_SIZE_MAX) {
log_ppp_error("pptp: message is too long\n");
goto drop;