https://bugs.winehq.org/show_bug.cgi?id=12401
--- Comment #56 from Erich E. Hoover erich.e.hoover@gmail.com --- I'm sorry I have not been very responsive lately, things have been very busy.
1) it looks like the original allocated buffer was two bytes too short because there should be added room for two WCHARs (as opposed to two chars). this is probably the real source of the problem. 2) you are no longer copying the NULL WCHAR into the nt_full_target buffer, while not strictly necessary I've found that it is _much_ harder to debug strange issues when you do not NULL-terminate these strings.
The other patch is certainly correct, my apologies for missing that previously.