From 3a0060c6eb7ae71221a6d08248af2fb356202583 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 10 Apr 2008 08:43:53 +0200 Subject: 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. --- rsyslog.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rsyslog.h') diff --git a/rsyslog.h b/rsyslog.h index 01329aaf..f0df7391 100644 --- a/rsyslog.h +++ b/rsyslog.h @@ -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 -- cgit