diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 68bdf7c38684..e11c84cfaee4 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -2226,6 +2226,8 @@ svr4_do_getmsg(td, uap, fp) } if (uap->ctl) { + if (ctl.len > sizeof(sc)) + ctl.len = sizeof(sc); if (ctl.len != -1) if ((error = copyout(&sc, ctl.buf, ctl.len)) != 0) return error;