Changeset 087a3c9 in nscp
- Timestamp:
- 02/19/08 19:10:56 (5 years ago)
- Children:
- 6922706
- Parents:
- 34f5502
- Location:
- trunk
- Files:
-
- 4 edited
-
NSClient++.cpp (modified) (1 diff)
-
changelog (modified) (1 diff)
-
include/NSCHelper.cpp (modified) (3 diffs)
-
modules/NRPEListener/NRPEListener.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/NSClient++.cpp
r34f5502 r087a3c9 534 534 } catch(const NSPluginException& e) { 535 535 LOG_ERROR_STD(_T("Exception raised: ") + e.error_ + _T(" in module: ") + e.file_); 536 return NSCAPI::returnCRIT; 537 } catch(...) { 538 LOG_ERROR_STD(_T("Unknown exception raised in module")); 536 539 return NSCAPI::returnCRIT; 537 540 } -
trunk/changelog
r34f5502 r087a3c9 6 6 * Add API for rehashing the daemon (or implement it the API is there but does nothing) 7 7 8 2008-02-19 MickeM 9 + Fixed a buffer overflow in the NRPE socket handling. 10 8 11 2008-02-18 MickeM 9 12 + Added propper output handling to process subsystem (now you can execute programs tat return "much" data. -
trunk/include/NSCHelper.cpp
rbe0202f r087a3c9 24 24 #include <msvc_wrappers.h> 25 25 #include <config.h> 26 #include <strEx.h> 26 27 27 28 #ifdef DEBUG … … 69 70 int NSCHelper::wrapReturnString(TCHAR *buffer, unsigned int bufLen, std::wstring str, int defaultReturnCode ) { 70 71 // @todo deprecate this 71 if (str.length() >= bufLen) 72 if (str.length() >= bufLen) { 73 std::wstring sstr = str.substr(0, min(10, str.length())); 74 NSC_DEBUG_MSG_STD(_T("String (") + strEx::itos(str.length()) + _T(") to long to fit inside buffer(") + strEx::itos(bufLen) + _T(") : ") + sstr); 72 75 return NSCAPI::isInvalidBufferLen; 76 } 73 77 wcsncpy_s(buffer, bufLen, str.c_str(), bufLen); 74 78 return defaultReturnCode; … … 110 114 else if (returnCode == NSCAPI::returnWARN) 111 115 return _T("WARNING"); 116 else if (returnCode == NSCAPI::returnUNKNOWN) 117 return _T("WARNING"); 112 118 else 113 return _T(" UNKNOWN");119 return _T("BAD_CODE"); 114 120 } 115 121 -
trunk/modules/NRPEListener/NRPEListener.cpp
r34f5502 r087a3c9 388 388 ret = NSCAPI::returnUNKNOWN; 389 389 } 390 if (msg.length() >= buffer_length_ ) {390 if (msg.length() >= buffer_length_-1) { 391 391 NSC_LOG_ERROR(_T("Truncating returndata as it is bigger then NRPE allowes :(")); 392 msg = msg.substr(0,buffer_length_- 1);392 msg = msg.substr(0,buffer_length_-2); 393 393 } 394 394 if (perf.empty()||noPerfData_) {
Note: See TracChangeset
for help on using the changeset viewer.








