diff options
author | Ray Johnston <ray.johnston@artifex.com> | 2018-07-09 12:05:56 -0700 |
---|---|---|
committer | Ray Johnston <ray.johnston@artifex.com> | 2019-01-07 15:40:02 -0800 |
commit | 0c89f7d14ffdaa3080d996d7502a77f3db949381 (patch) | |
tree | 4163e7870caa1840af3a87b7c34247413d812d04 /base/gsdevice.c | |
parent | e91b67894a28c518b34e0daf75d79715c4aa16e4 (diff) | |
download | ghostpdl-0c89f7d14ffdaa3080d996d7502a77f3db949381.tar.gz |
Fix for bug 692652: Prevent derefence of NULL if parsed.iodev == NULL
Robin's suggestion seems reasonable to me.
Diffstat (limited to 'base/gsdevice.c')
-rw-r--r-- | base/gsdevice.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/base/gsdevice.c b/base/gsdevice.c index 4c58e35ee..e885ae7fc 100644 --- a/base/gsdevice.c +++ b/base/gsdevice.c @@ -1243,7 +1243,8 @@ gx_device_open_output_file(const gx_device * dev, char *fname, parsed.fname = pfname; parsed.len = strlen(parsed.fname); } - if (positionable || (parsed.iodev && parsed.iodev != iodev_default(dev->memory))) { + if (parsed.iodev && + (positionable || parsed.iodev != iodev_default(dev->memory))) { char fmode[4]; if (!parsed.fname) { @@ -1259,8 +1260,7 @@ gx_device_open_output_file(const gx_device * dev, char *fname, emprintf1(dev->memory, "**** Could not open the file %s .\n", parsed.fname); - } - else { + } else { *pfile = gp_open_printer(dev->memory, (pfname[0] ? pfname : fname), binary); if (!(*pfile)) { emprintf1(dev->memory, "**** Could not open the file '%s'.\n", (pfname[0] ? pfname : fname)); |