Menu

#7 CStringA::AllocSysString() uses potentially wrong length

example
closed-fixed
David
None
5
2026-03-08
2026-03-05
toxie
No

Hi!
BSTR CStringA::AllocSysString() uses AtoW to convert to a wide string, but then still uses the 'old' length to allocate the memory for the BSTR. This may work most of the time, but can also be too short, depending on the string.

Discussion

  • David

    David - 2026-03-07

    I've submitted an SVN update that corrects the issue you've described in CStringA::AllocSysString.

    You can download the latest code snapshot from the code section here on SourceForge.

    Best regards,
    David

     
  • David

    David - 2026-03-07
    • status: open --> closed-fixed
    • assigned_to: David
     
  • toxie

    toxie - 2026-03-08

    Nice, thanks!

     

Log in to post a comment.

MongoDB Logo MongoDB