Skip to content
Snippets Groups Projects
Forked from The Tor Project / Core / Tor
Source project has a limited visibility.
  • Nick Mathewson's avatar
    1e5683b1
    Be more careful calling wcstombs · 1e5683b1
    Nick Mathewson authored
    The function is not guaranteed to NUL-terminate its output.  It
    *is*, however, guaranteed not to generate more than two bytes per
    multibyte character (plus terminating nul), so the general approach
    I'm taking is to try to allocate enough space, AND to manually add a
    NUL at the end of each buffer just in case I screwed up the "enough
    space" thing.
    
    Fixes bug 5909.
    1e5683b1
    History
    Be more careful calling wcstombs
    Nick Mathewson authored
    The function is not guaranteed to NUL-terminate its output.  It
    *is*, however, guaranteed not to generate more than two bytes per
    multibyte character (plus terminating nul), so the general approach
    I'm taking is to try to allocate enough space, AND to manually add a
    NUL at the end of each buffer just in case I screwed up the "enough
    space" thing.
    
    Fixes bug 5909.