diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-05-02 19:49:34 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-05-02 19:52:05 +0100 |
commit | b34e6835e6e918dfca8c6558fe00eedcca6660c5 (patch) | |
tree | 58e6654bcb99827a35c8447de3f9d4b7f8eff77f /gs/psi | |
parent | 505601bd6ee848be2aff84d264ae9583ae96c64a (diff) | |
download | ghostpdl-b34e6835e6e918dfca8c6558fe00eedcca6660c5.tar.gz |
Fix error in gsapi; gsapi_run_string is broken.
gsapi_run_string calls through to gsapi_run_string_with_length
with the first argument converted from a gs_lib_ctx_t * to a void *.
gsapi_run_string_with_length then performs this conversion again.
This will lead to a SEGV.
The fix is not to do this dereference.
Wouldn't it be better if we used types here rather than void *'s?
Diffstat (limited to 'gs/psi')
-rw-r--r-- | gs/psi/iapi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gs/psi/iapi.c b/gs/psi/iapi.c index a52270b6c..2a90eb57f 100644 --- a/gs/psi/iapi.c +++ b/gs/psi/iapi.c @@ -415,8 +415,7 @@ GSDLLEXPORT int GSDLLAPI gsapi_run_string(void *lib, const char *str, int user_errors, int *pexit_code) { - gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib; - return gsapi_run_string_with_length(get_minst_from_memory(ctx->memory), + return gsapi_run_string_with_length(lib, str, (uint)strlen(str), user_errors, pexit_code); } |