summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2015-06-22 14:18:49 +0100
committerKen Sharp <ken.sharp@artifex.com>2015-06-22 14:18:49 +0100
commit30f0a322ea0643366a93274e03dc80e226a7b822 (patch)
tree715f939052844b7cf29835dc5cdc553663cbea4a
parent0f7ab3e067a5e8b8434312ca5ce364869288eeec (diff)
downloadghostpdl-30f0a322ea0643366a93274e03dc80e226a7b822.tar.gz
Coverity ID #94648, ensure a pointer cannot be dereferenced if NULL. In
practice it can't happen because we check the size of the data firs, and the size is initialised to 0. But it is slightly safer to be certain.
-rw-r--r--gs/devices/vector/gdevpdfm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gs/devices/vector/gdevpdfm.c b/gs/devices/vector/gdevpdfm.c
index 92319b698..bf9bb0883 100644
--- a/gs/devices/vector/gdevpdfm.c
+++ b/gs/devices/vector/gdevpdfm.c
@@ -60,7 +60,7 @@ typedef struct pdfmark_name_s {
bool
pdf_key_eq(const gs_param_string * pcs, const char *str)
{
- return (strlen(str) == pcs->size &&
+ return (strlen(str) == pcs->size && pcs->data &&
!strncmp(str, (const char *)pcs->data, pcs->size));
}