Increase token buffer to 256 bytes, to avoid overflow scenarios.

Add _pdfioTokenFlush to manually flush the token buffer.

Add more debug printfs.
This commit is contained in:
Michael R Sweet
2021-05-10 17:37:57 -04:00
parent cfb5ca0ddc
commit 18853ca3d5
7 changed files with 93 additions and 37 deletions

View File

@ -215,12 +215,14 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
}
// Now see if there is an associated stream...
if (!_pdfioFileGets(obj->pdf, line, sizeof(line)))
if (!_pdfioTokenGet(&tb, line, sizeof(line)))
{
_pdfioFileError(obj->pdf, "Early end-of-file for object %lu.", (unsigned long)obj->number);
return (false);
}
_pdfioTokenFlush(&tb);
if (!strcmp(line, "stream"))
{
// Yes, save its location...