certik / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Visual Studio 2013 memory corruption #239

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This line:
    m_buffer[m_pos] = '\0';
segfaults when the m_buffer had a zero length.

# ostream_wrapper.h
const char *str() const {
            if(m_pStream) {
                return 0;
            } else {
                if(m_buffer.size() <= m_pos){
                    m_buffer.resize(m_pos+1); <<<<<<
                }
                m_buffer[m_pos] = '\0';
                return &m_buffer[0];
            }
        }

Original issue reported on code.google.com by dgalli...@gmail.com on 20 Mar 2014 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by jbe...@gmail.com on 20 Mar 2014 at 10:08

GoogleCodeExporter commented 9 years ago
Fixed, r78d442a31d59.

Original comment by jbe...@gmail.com on 23 Mar 2014 at 12:28