summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2013-06-05 09:52:08 +0200
committerSven Verdoolaege <skimo@kotnet.org>2013-06-05 09:52:08 +0200
commit26880800630424c383fc26fdbde4c9fde114fbd0 (patch)
treeb13dde13c83aef3d2ecdb18b19d9078ca5761007
parentde51a9bc4da5dd3f1f9f57c2362da6f9752c44e0 (diff)
downloadisl-26880800630424c383fc26fdbde4c9fde114fbd0.tar.gz
isl-26880800630424c383fc26fdbde4c9fde114fbd0.tar.bz2
isl-26880800630424c383fc26fdbde4c9fde114fbd0.zip
isl_basic_map_contains: avoid invalid access on error path
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r--isl_map.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/isl_map.c b/isl_map.c
index c4636c14..17915e1d 100644
--- a/isl_map.c
+++ b/isl_map.c
@@ -2708,6 +2708,9 @@ int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec)
unsigned total;
isl_int s;
+ if (!bmap || !vec)
+ return -1;
+
total = 1 + isl_basic_map_total_dim(bmap);
if (total != vec->size)
return -1;