summaryrefslogtreecommitdiff
path: root/isl_mat.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-06-26 10:54:28 +0200
committerSven Verdoolaege <skimo@kotnet.org>2010-06-26 17:37:40 +0200
commitbf0432e582c5d39acf88a5c021ef71f97b328c19 (patch)
treed1b21a24be7f9d73ebda2c1be10ac90ea9b35e7b /isl_mat.c
parenta24400b94a12cb56d7d9bb74a73afa0d3ccc5f05 (diff)
downloadisl-bf0432e582c5d39acf88a5c021ef71f97b328c19.tar.gz
isl-bf0432e582c5d39acf88a5c021ef71f97b328c19.tar.bz2
isl-bf0432e582c5d39acf88a5c021ef71f97b328c19.zip
isl_basic_set_preimage: avoid NULL pointer dereference
Diffstat (limited to 'isl_mat.c')
-rw-r--r--isl_mat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/isl_mat.c b/isl_mat.c
index 13332e6d..a019ce19 100644
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -975,10 +975,11 @@ struct isl_basic_set *isl_basic_set_preimage(struct isl_basic_set *bset,
isl_assert(ctx, 1+bset->dim->n_out == mat->n_row, goto error);
isl_assert(ctx, mat->n_col > 0, goto error);
- if (mat->n_col > mat->n_row)
- bset = isl_basic_set_extend(bset, 0, mat->n_col-1, 0,
- 0, 0);
- else if (mat->n_col < mat->n_row) {
+ if (mat->n_col > mat->n_row) {
+ bset = isl_basic_set_extend(bset, 0, mat->n_col-1, 0, 0, 0);
+ if (!bset)
+ goto error;
+ } else if (mat->n_col < mat->n_row) {
bset->dim = isl_dim_cow(bset->dim);
if (!bset->dim)
goto error;