diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-08 17:15:18 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-08 17:15:18 +0100 |
commit | c29b6b6415f668cc3933e7fcc40425fe9f18607f (patch) | |
tree | f4dba64b4394001367e6cd35a7eed228bb34b4f7 /runtime/librsgt.c | |
parent | 39b91ca4e7b40d4a1ab3fb8ac857cecc084b7308 (diff) | |
download | rsyslog-c29b6b6415f668cc3933e7fcc40425fe9f18607f.tar.gz rsyslog-c29b6b6415f668cc3933e7fcc40425fe9f18607f.tar.bz2 rsyslog-c29b6b6415f668cc3933e7fcc40425fe9f18607f.zip |
logsig: fix subroot forest handling
Diffstat (limited to 'runtime/librsgt.c')
-rw-r--r-- | runtime/librsgt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/librsgt.c b/runtime/librsgt.c index aa74f09d..9d112a08 100644 --- a/runtime/librsgt.c +++ b/runtime/librsgt.c @@ -542,14 +542,15 @@ sigblkAddRecord(gtctx ctx, const uchar *rec, const size_t len) t = x; for(j = 0 ; j < ctx->nRoots ; ++j) { if(ctx->roots_valid[j] == 0) { - GTDataHash_free(ctx->roots_hash[j]); ctx->roots_hash[j] = t; ctx->roots_valid[j] = 1; t = NULL; + break; } else if(t != NULL) { /* hash interim node */ hash_node(ctx, &t, ctx->roots_hash[j], t, j+2); ctx->roots_valid[j] = 0; + GTDataHash_free(ctx->roots_hash[j]); // TODO: check if this is correct location (paper!) if(ctx->bKeepTreeHashes) tlvWriteHash(ctx, 0x0901, t); @@ -558,6 +559,7 @@ sigblkAddRecord(gtctx ctx, const uchar *rec, const size_t len) if(t != NULL) { /* new level, append "at the top" */ ctx->roots_hash[ctx->nRoots] = t; + ctx->roots_valid[ctx->nRoots] = 1; ++ctx->nRoots; assert(ctx->nRoots < MAX_ROOTS); t = NULL; |