Trying to come up with a promise to verify lib/3.6/paths.cf (see attached file), cf-agent segfaults in libpromises at syntax.c:535
I run it with
cf-agent -f ./paths.cf
Note: I'm using the master branch of 'core' from github
Backtrack:
#0 0x00007f7c80461eba in __strcmp_ssse3 () from /lib64/libc.so.6
#1 0x00007f7c82e60c06 in CheckParseContext (context=0x0, range=0x7f7c82e98d53 "[a-zA-Z0-9_!&@@$|.()\\[
]{}:]+") at syntax.c:535
#2 0x00007f7c82e6090b in CheckConstraintTypeMatch (lval=0x7f7c830e6358 <P+3128> "expression", rval=..., dt=CF_DATA_TYPE_CONTEXT, range=0x7f7c82e98d53 "[a-zA-Z0-9_!&@@$|.()\\[
]{}:]+", level=0)
at syntax.c:389
#3 0x00007f7c82e0f744 in CheckConstraint (type=0x7f7c830e6b88 <P+5224> "classes", lval=0x7f7c830e6358 <P+3128> "expression", rval=..., promise_type_syntax=0x7f7c830d05e0 <CF_COMMON_PROMISE_TYPES>)
at cf3parse.y:1431
#4 0x00007f7c82e0c0d1 in yyparse () at cf3parse.y:578
#5 0x00007f7c82e5774e in ParserParseFile (agent_type=AGENT_TYPE_AGENT, path=0x1abd8e0 "./paths.cf", warnings=0, warnings_error=0) at parser.c:129
#6 0x00007f7c82e47f38 in Cf3ParseFile (config=0x1abd810, input_path=0x1abd8e0 "./paths.cf") at loading.c:102
#7 0x00007f7c82e486c8 in LoadPolicyFile (ctx=0x1abddc0, config=0x1abd810, policy_file=0x1abd8e0 "./paths.cf", parsed_files_and_checksums=0x1af6b30, failed_files=0x1af6ac0) at loading.c:293
#8 0x00007f7c82e48caa in LoadPolicy (ctx=0x1abddc0, config=0x1abd810) at loading.c:446
#9 0x000000000040dbb6 in main (argc=<optimized out>, argv=<optimized out>) at cf-agent.c:243
The call
CheckParseContext((const char *) rval.item, range);
at syntax.c:389 passes a NULL pointer:
(gdb) print rval
$1 =