Comment 2 for bug 1065845

Revision history for this message
Basil Semuonov (basil-semuonov) wrote :

The problem is actually in processing "-sOutputFile" command line parameter.

File ./base/gsparam2.c contains a define:

#define MAX_PARAM_KEY 255

so if length of path -sOutputFile > MAX_PARAM_KEY security check performed:
gsparam2.c:73
---
char string_key[MAX_PARAM_KEY + 1];

if (sizeof(string_key) < key.size + 1) {
   code = gs_note_error(gs_error_rangecheck);
   break;
}
---

Seems not a bug, but a strong restriction for input arguments, and "magic" numbers in code.