From 792ac397f40251ca2c7dee30a4955bf506c4d1b4 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 9 Mar 2017 15:22:11 +0000 Subject: [PATCH] stopon truncated file --- descriptor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/descriptor.c b/descriptor.c index 35234c1..4556863 100644 --- a/descriptor.c +++ b/descriptor.c @@ -62,6 +62,9 @@ read_lstring(struct epg *epg, unsigned int *len) if (epg->binsize - epg->offset < l) l = epg->binsize - epg->offset; + if (l < 1) + return strdup("Short file"); + c = malloc(l + 1); memcpy(c, epg->bin + epg->offset, l); c[l] = '\0';