diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2010-06-26 10:54:28 +0200 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2010-06-26 17:37:40 +0200 |
commit | bf0432e582c5d39acf88a5c021ef71f97b328c19 (patch) | |
tree | d1b21a24be7f9d73ebda2c1be10ac90ea9b35e7b /isl_mat.c | |
parent | a24400b94a12cb56d7d9bb74a73afa0d3ccc5f05 (diff) | |
download | isl-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.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; |