From 0c7ca27b8bf01170258aeb24c87a26680becafc8 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 17 Jul 2012 19:01:21 +0200 Subject: [PATCH] isl_stream_new_str: fail on NULL input Signed-off-by: Sven Verdoolaege --- isl_stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/isl_stream.c b/isl_stream.c index c70b4bee..68f6e522 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -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; -- 2.11.4.GIT