diff options
Diffstat (limited to 'sys/geom/geom_ctl.c')
-rw-r--r-- | sys/geom/geom_ctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c index ae07cf696a55..3eddc832f9b4 100644 --- a/sys/geom/geom_ctl.c +++ b/sys/geom/geom_ctl.c @@ -139,6 +139,12 @@ gctl_copyin(struct gctl_req *req) char *p; u_int i; + if (req->narg > GEOM_CTL_ARG_MAX) { + gctl_error(req, "too many arguments"); + req->arg = NULL; + return; + } + ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { gctl_error(req, "bad control request"); |