summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2018-09-06 14:08:41 +0100
committerChris Liddell <chris.liddell@artifex.com>2018-09-06 17:14:28 +0100
commitc8c01f8c4164bc10281d9e8f87cf96314d93104b (patch)
tree0c2b1a5a15bae5ec6975a4d8979ff14e9144f4e2
parentfb713b3818b52d8a6cf62c951eba2e1795ff9624 (diff)
downloadghostpdl-c8c01f8c4164bc10281d9e8f87cf96314d93104b.tar.gz
Bug 699722: Add the ICCProfilesDir to the PermitReading list
There was also an issue that the string being returned from the graphics library was null terminated, and Postscript strings are not (and Ghostscript strings are not necessarily). We leave the null termination in place, but reduce the length returned by 1.
-rw-r--r--Resource/Init/gs_init.ps1
-rw-r--r--base/gsicc_manage.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index bc8b7951c..83918a96f 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -2049,6 +2049,7 @@ readonly def
[ currentsystemparams /GenericResourceDir get] (*) .file_name_separator (*)
concatstrings concatstrings .generate_dir_list_templates
} if
+ currentuserparams /ICCProfilesDir known {currentuserparams /ICCProfilesDir get} if
]
/PermitFileWriting [
currentuserparams /PermitFileWriting get aload pop
diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c
index 69f05c48c..ff685e7e5 100644
--- a/base/gsicc_manage.c
+++ b/base/gsicc_manage.c
@@ -2972,7 +2972,7 @@ gs_currenticcdirectory(const gs_gstate * pgs, gs_param_string * pval)
pval->persistent = true;
} else {
pval->data = (const byte *)(lib_ctx->profiledir);
- pval->size = lib_ctx->profiledir_len;
+ pval->size = lib_ctx->profiledir_len - 1;
pval->persistent = false;
}
}