Summary: | utf8-Ghostscript: Crash if any of the GS_ environment variables not defined | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | SaGS <sags5495> |
Component: | General | Assignee: | Default assignee <ghostpdl-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alex |
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Customer: | Word Size: | --- | |
Attachments: | Suggested patch. |
Description
SaGS
2011-07-16 19:06:11 UTC
Created attachment 7679 [details] Suggested patch. Bug #692348: utf8-Ghostscript - Crash if any of the GS_ environment variables not defined. For GS_ registry entries that are not set, the utf8 version of 'gp_getenv_registry()' incorrectly returned an 'insufficient buffer space' verdict and let the 'needed buffer size' to 0 (cbData = 0 after 'RegQueryValueExW()'). The call to fetch the value was then made also with a 0-sized buffer, did the same thing, and left the buffer for the value undefined. There were also other problems, for example non-REG_SZ entries were ignored only when the value was actually requested (not during the request for the buffer size) and the function was doing 'free(wp)' with wp == NULL in a few cases. This patch has been committed by Ray on 2011-07-17 as a rev. 44a2fd0bb1e2dd12e9ba475da0bdbb93081325d5 |