Skip to content
Prev 20286 / 63421 Next

Crash in de()

Peter Dalgaard <p.dalgaard at biostat.ku.dk> writes:
OK, got it. The printstring() function in dataentry.c had three
instances like

cnt=wcsrtombs(s,(const wchar_t **)&w_p,sizeof(wcs),NULL);

s has length BOOSTED_BUF_SIZE==201 and sizeof(wcs)==804; the third
argument is documented to limit the number of bytes copied _to the
destination_, so that's clearly not right. Apparently, the check is
preemptive since the actual strings involved are nowhere near the
buffer limits. Replacing the 3rd argument with BOOSTED_BUF_SIZE-1
seems to do the trick.

Will fix for tomorrows 2.3.0 RC (we're in code freeze, but I think
this counts as a critical as well as trivial fix).