From 00c699ae751519a0fc8f25fb99cb0554e5b3f617 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 27 Dec 2019 15:54:46 +1100 Subject: [PATCH] split_stream: guard against body being NULL. If body is NULL, adding 'len' to it makes no sense. Just abort early in that case. Signed-off-by: NeilBrown --- split.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/split.c b/split.c index 367a590..27f9b7e 100644 --- a/split.c +++ b/split.c @@ -125,9 +125,13 @@ struct file split_stream(struct stream s, int type) { int cnt; struct file f; - char *c, *end; + if (!s.body) { + f.list = NULL; + f.elcnt = 0; + return f; + } end = s.body+s.len; c = s.body; -- 2.39.5