X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=d04a4f70fa5ac64ced2b27552c360123ee978498;hb=ae2444732c85010baa41e44e9b6183ba403a4e86;hp=3357994c4a4a04757b9a0117a5779482db3a7ff6;hpb=287b27a6720d10ff6563c24281933eaffceda775;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 3357994c4a..d04a4f70fa 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -384,12 +384,15 @@ dict_unset_split_var (struct dictionary *d, struct variable *v, bool skip_callba } -/* Sets N split vars SPLIT in dictionary D. */ +/* Sets N split vars SPLIT in dictionary D. N is silently capped to a maximum + of MAX_SPLITS. */ static void dict_set_split_vars__ (struct dictionary *d, struct variable *const *split, size_t n, enum split_type type, bool skip_callbacks) { + if (n > MAX_SPLITS) + n = MAX_SPLITS; assert (n == 0 || split != NULL); d->n_splits = n;