Open StrongestNumber9 opened 3 years ago
Note: Using the compat asprintf as the OS doesn't provide one.
# dump -Tv liblognorm.so.5 | grep -i asprintf
[389] 0x00000000 undef IMP DS EXTref [noIMid] asprintf
For whatever reason lognormalizer binary seems to work if I do extra null check but I have no idea what are the long term effects when used in rsyslog for example:
# git diff
diff --git a/src/pdag.c b/src/pdag.c
index 44a3847..9fb2cc2 100644
--- a/src/pdag.c
+++ b/src/pdag.c
@@ -497,10 +497,12 @@ ln_pdagComponentSetIDs(ln_ctx ctx, struct ln_pdag *const dag, const char *prefix
goto done;
}
} else {
+ if(prs->name == NULL) {
if(asprintf(&id, "%s%%%s:%s%%", prefix,
prs->name ? prs->name : "-",
parserName(prs->prsid)) == -1)
goto done;
+ }
}
ln_pdagComponentSetIDs(ctx, prs->node, id);
free(id);
Running on AIX 7.1 and newest liblognorm release
Test file, nothing interesting.
Try it normally
Change newlines to dos style
And try again..
Truss outputs as well, if any use.
dbx output from the core: