> On Jan. 5, 2015, 6:01 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/include/process/socket.hpp, line 84 > > <https://reviews.apache.org/r/29528/diff/1/?file=805377#file805377line84> > > > > from experience, this is a potential source of bugs due to strings > > being NULL terminated. Ie, if someone tries to use this overload to send > > arbitrary bytes that contain a \0, it will be truncated.
We've used a std::string to represent a "bytes array" in the past as well, hence why I used it here. I've also seen plenty of implementations that assume use of std::string::data() and std::string::size() instead of std::string::c_str() to avoid NULL terminated string issues. - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29528/#review66671 ----------------------------------------------------------- On Jan. 21, 2015, 5:42 p.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/29528/ > ----------------------------------------------------------- > > (Updated Jan. 21, 2015, 5:42 p.m.) > > > Review request for mesos, Joris Van Remoortere and Niklas Nielsen. > > > Repository: mesos-git > > > Description > ------- > > See summary. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/socket.hpp > ddb9e365fc1e65a568bdac4973964df1ab8cc05e > 3rdparty/libprocess/src/socket.cpp 4b0f6bec8051f938812dbc90a7312e4082ea203f > > Diff: https://reviews.apache.org/r/29528/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Hindman > >
