diff options
-rw-r--r-- | Resource/Init/gs_dps1.ps | 2 | ||||
-rw-r--r-- | psi/interp.c | 33 |
2 files changed, 25 insertions, 10 deletions
diff --git a/Resource/Init/gs_dps1.ps b/Resource/Init/gs_dps1.ps index 1182f53e6..ec5db61b9 100644 --- a/Resource/Init/gs_dps1.ps +++ b/Resource/Init/gs_dps1.ps | |||
@@ -21,7 +21,7 @@ level2dict begin | |||
21 | % ------ Virtual memory ------ % | 21 | % ------ Virtual memory ------ % |
22 | 22 | ||
23 | /currentshared /.currentglobal load def | 23 | /currentshared /.currentglobal load def |
24 | /scheck /.gcheck load def | 24 | /scheck {.gcheck} bind odef |
25 | %****** FOLLOWING IS WRONG ****** | 25 | %****** FOLLOWING IS WRONG ****** |
26 | /shareddict currentdict /globaldict .knownget not { 20 dict } if def | 26 | /shareddict currentdict /globaldict .knownget not { 20 dict } if def |
27 | 27 | ||
diff --git a/psi/interp.c b/psi/interp.c index cd894f96c..b70769d0c 100644 --- a/psi/interp.c +++ b/psi/interp.c | |||
@@ -678,6 +678,8 @@ again: | |||
678 | epref = &doref; | 678 | epref = &doref; |
679 | /* Push the error object on the operand stack if appropriate. */ | 679 | /* Push the error object on the operand stack if appropriate. */ |
680 | if (!GS_ERROR_IS_INTERRUPT(code)) { | 680 | if (!GS_ERROR_IS_INTERRUPT(code)) { |
681 | byte buf[260], *bufptr; | ||
682 | uint rlen; | ||
681 | /* Replace the error object if within an oparray or .errorexec. */ | 683 | /* Replace the error object if within an oparray or .errorexec. */ |
682 | osp++; | 684 | osp++; |
683 | if (osp >= ostop) { | 685 | if (osp >= ostop) { |
@@ -686,23 +688,36 @@ again: | |||
686 | } | 688 | } |
687 | *osp = *perror_object; | 689 | *osp = *perror_object; |
688 | errorexec_find(i_ctx_p, osp); | 690 | errorexec_find(i_ctx_p, osp); |
689 | /* If using SAFER, hand a name object to the error handler, rather than the executable | 691 | |
690 | * object/operator itself. | 692 | if (!r_has_type(osp, t_string) && !r_has_type(osp, t_name)) { |
691 | */ | ||
692 | if (i_ctx_p->LockFilePermissions) { | ||
693 | code = obj_cvs(imemory, osp, buf + 2, 256, &rlen, (const byte **)&bufptr); | 693 | code = obj_cvs(imemory, osp, buf + 2, 256, &rlen, (const byte **)&bufptr); |
694 | if (code < 0) { | 694 | if (code < 0) { |
695 | const char *unknownstr = "--unknown--"; | 695 | const char *unknownstr = "--unknown--"; |
696 | rlen = strlen(unknownstr); | 696 | rlen = strlen(unknownstr); |
697 | memcpy(buf, unknownstr, rlen); | 697 | memcpy(buf, unknownstr, rlen); |
698 | bufptr = buf; | ||
698 | } | 699 | } |
699 | else { | 700 | else { |
700 | buf[0] = buf[1] = buf[rlen + 2] = buf[rlen + 3] = '-'; | 701 | ref *tobj; |
701 | rlen += 4; | 702 | bufptr[rlen] = '\0'; |
703 | /* Only pass a name object if the operator doesn't exist in systemdict | ||
704 | * i.e. it's an internal operator we have hidden | ||
705 | */ | ||
706 | code = dict_find_string(systemdict, (const char *)bufptr, &tobj); | ||
707 | if (code < 0) { | ||
708 | buf[0] = buf[1] = buf[rlen + 2] = buf[rlen + 3] = '-'; | ||
709 | rlen += 4; | ||
710 | bufptr = buf; | ||
711 | } | ||
712 | else { | ||
713 | bufptr = NULL; | ||
714 | } | ||
715 | } | ||
716 | if (bufptr) { | ||
717 | code = name_ref(imemory, buf, rlen, osp, 1); | ||
718 | if (code < 0) | ||
719 | make_null(osp); | ||
702 | } | 720 | } |
703 | code = name_ref(imemory, buf, rlen, osp, 1); | ||
704 | if (code < 0) | ||
705 | make_null(osp); | ||
706 | } | 721 | } |
707 | } | 722 | } |
708 | goto again; | 723 | goto again; |