stopon truncated file

This commit is contained in:
hummypkg 2017-03-09 15:22:11 +00:00 committed by HummyPkg
parent 2b0eeebc30
commit 792ac397f4
1 changed files with 3 additions and 0 deletions

View File

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