isl_stream_new_str: fail on NULL input
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 17 Jul 2012 17:01:21 +0000 (19:01 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 18 Sep 2012 13:08:20 +0000 (15:08 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_stream.c

index c70b4be..68f6e52 100644 (file)
@@ -173,7 +173,10 @@ struct isl_stream* isl_stream_new_file(struct isl_ctx *ctx, FILE *file)
 
 struct isl_stream* isl_stream_new_str(struct isl_ctx *ctx, const char *str)
 {
-       struct isl_stream *s = isl_stream_new(ctx);
+       struct isl_stream *s;
+       if (!str)
+               return NULL;
+       s = isl_stream_new(ctx);
        if (!s)
                return NULL;
        s->str = str;