It lives, Igor, it lives!
As an added bonus, a new feature of the VS7 compiler pointed out a buffer overrun in the code. This feature is enabled by the /Gs compiler switch and works by inserting guard bytes in each stack frame. If the guard bytes are modified during the invocation of a function, the compiler aborts with a message…. just not under the VS automation model… it was suppressed. The only indication I had was that devenv.exe was aborting after the call to gnuclient. The problem was relatively simple:
char Name[4096];
hr = get_fullname(generic_doc, Name, sizeof Name);
where get_fullname was trying to be smart, but had the genetic fencepost error:
_snprintf(name, maxch, ""%S"", (BSTR)FullName);
name[maxch] = 0;
Do you see the bug?
Filed under: News

uh, should be maxch-1?