isl_basic_map_contains: avoid invalid access on error path
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:52:08 +0000 (09:52 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:52:08 +0000 (09:52 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index c4636c1..17915e1 100644 (file)
--- 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;