summaryrefslogtreecommitdiffstats
path: root/sys/geom/part/g_part.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/part/g_part.c')
-rw-r--r--sys/geom/part/g_part.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 78c3650..6e81a9c 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;
OpenPOWER on IntegriCloud