achille-roussel / nanomsgxx

Nanomsg binding for C++11
MIT License
115 stars 35 forks source link

Test #1: message ***Failed #20

Open Ales999 opened 6 years ago

Ales999 commented 6 years ago

Hello. After build and run:

ctest -C Debug .

first test is fails, other tests is ok.

message.cpp: ... message::~message() { if (m_data != nullptr) {

ifdef NDEBUG

  nn_freemsg(m_data);

else

  if (nn_freemsg(m_data) != 0) { //  !!! THIS Fails !!!
    std::fprintf(stderr, "warning: nn_freemsg: %s\n", strerror());
  }

endif

}

} ...

Build and compile with VS 2017 with last updates. Using stable 'nanomsg', version v1.1.5

2018-11-13 15 18 28

chhinze commented 6 years ago

Macro variable NDEBUG=1 was not defined in CMakeLists. Further, there was a buffer overflow due to std::strcpy appending a trailing \0 character. Does PR #21 solve this problem?