Boost logo

Boost :

Subject: Re: [boost] Integrating Boost.Process and Boost.Asio
From: Johannes Brunen (JBrunen_at_[hidden])
Date: 2008-10-03 16:35:03

Hi Boris,

yet another problem this time with win32_startup.cpp example.
At first, I had to change the STARTUPINFO struct into a
STARTUPINFOA struct in order to compile the code.

However, a more serious problem showed up in file win32_ops.hpp
line 81.

boost::shared_array<char> cmdline(new char[size]);
cmdline.get()[0] = '\0';

In the example the size is zero, because no arguments are provided.
I do not know what exactly new char[0] should be in standardese.
However, IMHO the next line does not work for this case.

cmdline.get()[0] = '\0';

Later, on destruction of the shared_array cmdline an exception is thrown
in function checked_array_delete on calling operator delete[].


Boost list run by bdawes at, gregod at, cpdaniel at, john at