summaryrefslogtreecommitdiffstats
path: root/tools/omfwd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-13 14:24:16 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-13 14:24:16 +0200
commit89e18de662ef563e58eb04f51f2966efcd4c3fab (patch)
tree7f84c61c354ce5f32f490ceed698c5c4b74bf9d4 /tools/omfwd.c
parent538543f6d0d4f279301bccf9a9c05ea6a02230a4 (diff)
downloadrsyslog-89e18de662ef563e58eb04f51f2966efcd4c3fab.tar.gz
rsyslog-89e18de662ef563e58eb04f51f2966efcd4c3fab.tar.xz
rsyslog-89e18de662ef563e58eb04f51f2966efcd4c3fab.zip
bugfix: sending syslog messages with zip compression did not work
Diffstat (limited to 'tools/omfwd.c')
-rw-r--r--tools/omfwd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/omfwd.c b/tools/omfwd.c
index e62f84b7..b6565dd1 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -411,11 +411,11 @@ CODESTARTdoAction
*/
if(pData->compressionLevel && (l > MIN_SIZE_FOR_COMPRESS)) {
Bytef *out;
- uLongf destLen = sizeof(out) / sizeof(Bytef);
+ teste das hier! uLongf destLen = iMaxLine + iMaxLine/100 +12; /* recommended value from zlib doc */
uLong srcLen = l;
int ret;
/* TODO: optimize malloc sequence? -- rgerhards, 2008-09-02 */
- CHKmalloc(out = (Bytef*) malloc(iMaxLine + iMaxLine/100 + 12));
+ CHKmalloc(out = (Bytef*) malloc(destlen));
out[0] = 'z';
out[1] = '\0';
ret = compress2((Bytef*) out+1, &destLen, (Bytef*) psz,