diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-10 08:43:53 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-10 08:43:53 +0200 |
commit | 3a0060c6eb7ae71221a6d08248af2fb356202583 (patch) | |
tree | cc761ead0279e384d107ba4135d7849197bd2d8e /rsyslog.h | |
parent | 3853f06d948703f6a28fa6a131ea04521543d011 (diff) | |
download | rsyslog-3a0060c6eb7ae71221a6d08248af2fb356202583.tar.gz rsyslog-3a0060c6eb7ae71221a6d08248af2fb356202583.tar.xz rsyslog-3a0060c6eb7ae71221a6d08248af2fb356202583.zip |
bugfix: omsnmp had a too-small sized buffer for hostname+port.
This could not lead to a segfault, as snprintf() was used, but could cause
some trouble with extensively long hostnames.
Diffstat (limited to 'rsyslog.h')
-rw-r--r-- | rsyslog.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -181,6 +181,8 @@ typedef enum rsRetVal_ rsRetVal; /**< friendly type for global return value */ #define CHKiRet(code) if((iRet = code) != RS_RET_OK) goto finalize_it /* macro below is to be used if we need our own handling, eg for cleanup */ #define CHKiRet_Hdlr(code) if((iRet = code) != RS_RET_OK) +/* macro below is to handle failing malloc/calloc/strdup... which we almost always handle in the same way... */ +#define CHKmalloc(operation) if((operation) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY) /* macro below is used in conjunction with CHKiRet_Hdlr, else use ABORT_FINALIZE */ #define FINALIZE goto finalize_it; #define DEFiRet BEGINfunc rsRetVal iRet = RS_RET_OK |