diff options
author | 2020-03-19 13:53:45 +0100 | |
---|---|---|
committer | 2020-08-13 11:28:25 +0200 | |
commit | dc2ba49207af71193f1390d84bba4e15aeea0ce0 (patch) | |
tree | 79c2a51cb5fa2b87800b1113e0015a7108cd2eb3 /psi/dscparse.c | |
parent | Import Ghostscript 9.50 (diff) | |
download | ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.gz ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.bz2 ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.zip |
Import Ghostscript 9.52ghostscript-9.52
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'psi/dscparse.c')
-rw-r--r-- | psi/dscparse.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/psi/dscparse.c b/psi/dscparse.c index e754a82c..0c34eb14 100644 --- a/psi/dscparse.c +++ b/psi/dscparse.c @@ -3822,7 +3822,7 @@ dsc_dcs2_fixup(CDSC *dsc) DSC_OFFSET *pbegin; DSC_OFFSET *pend; DSC_OFFSET end; - CDCS2 *pdcs = dsc->dcs2; + CDCS2 *pdcs = NULL; /* Now treat the initial EPS file as a single page without * headers or trailer, so page extraction will fetch the * the correct separation. */ @@ -3888,6 +3888,14 @@ dsc_dcs2_fixup(CDSC *dsc) *pbegin = *pend; end = 0; /* end of composite is start of first separation */ + /* we used to do this where the pointer is declared, but Coverity points out + * that dsc_alloc_string can call dsc_reset which can free dsc and dsc->dcs2. + * By deferring the initialisation to here we can ensure we don't have a + * dangling pointer. This makes me suspiciouos that DCS (not DSC!) comments + * have never worked properly. + */ + pdcs = dsc->dcs2; + while (pdcs) { page_number = dsc->page_count; if ((pdcs->begin) && (pdcs->colourname != NULL)) { |