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';