stopon truncated file
This commit is contained in:
parent
2b0eeebc30
commit
792ac397f4
|
@ -62,6 +62,9 @@ read_lstring(struct epg *epg, unsigned int *len)
|
||||||
if (epg->binsize - epg->offset < l)
|
if (epg->binsize - epg->offset < l)
|
||||||
l = epg->binsize - epg->offset;
|
l = epg->binsize - epg->offset;
|
||||||
|
|
||||||
|
if (l < 1)
|
||||||
|
return strdup("Short file");
|
||||||
|
|
||||||
c = malloc(l + 1);
|
c = malloc(l + 1);
|
||||||
memcpy(c, epg->bin + epg->offset, l);
|
memcpy(c, epg->bin + epg->offset, l);
|
||||||
c[l] = '\0';
|
c[l] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue