diff options
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/part/g_part.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 78c36501326b..6e81a9c70b68 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -480,6 +480,10 @@ g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp) gctl_error(req, "%d index '%d'", EEXIST, gpp->gpp_index); return (EEXIST); } + if (index > table->gpt_entries) { + gctl_error(req, "%d index '%d'", ENOSPC, index); + return (ENOSPC); + } entry = (delent == NULL) ? g_malloc(table->gpt_scheme->gps_entrysz, M_WAITOK | M_ZERO) : delent; |