This is now a hard requirement for current pull requests
to ensure we don't walk back into this messy codebase
situation again.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
Make template_context_process_line() and template_string()
return cve_string instead of standard C string.
These changes are prepare for upcoming changes to the
HTML output plugin where we need to access report string
length to figure out if report was truncated.
Probably other users will benefit from this change in
the future too.
Among other changes, introduced with this patch, minor
improvements to the cve_string handling is added to
template_context_process_line(), where we avoid string
unnecessary string duplication where possible and save
few CPU cycles on string copy. Check for @original string
parameter being non-NULL (in template_conext_process_line()
with cve_string_dup() and in template_string() with explicit
check).
Also fixes potential memory leak in JIRA plugin where we
resulting string from template_string() not freed.
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
This is currently the temporary path we'll use, as and when the packaging
implementations switch to plugins, we can drop the current callback mechanism,
abstract util.*, and query supported package types and then determine the
plugin we'll use for the lifetime of this operation.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
Turns out this was a ccache issue. Alternative implementation to this is
is forcing clang diagnostics via a pragma but that seems nasty, besides this
is still within C99 compliance, though it'd be nice if clang would choose the
members itself vs being told one to start with.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This reverts commit 3b57d46503.
It would seem this causes some clang versions to explode quite violently.
And in truth, parts of this change should not be necessary (the struct
zero initialisation)
This is the beginning of a large refactor to greatly improve performance
and flexibility of cve-check-tool. Core functionality is still unaltered right
now, as this change simply introduces the new initial core. This core uses
a named database to store all NVD data for later retrieval.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
We now build a complete unexpanded section at a time whilst iterating the
document structure. As we exit each subsection, we push our block into the
parent render block. This leads to a bottom up render approach for emitting
sections, skipping non-emitters. In future this can be expanded upon by
enabling iterative conditional sections, as a full section block is available
to render as many times as required into the parent context.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
We now swap the old code out for a new lighter "TemplateContext", which
currently now supports conditional renders via Mustache-style sections.
In the future this will be revisted further to add iteration supports,
but for now stack-traversing child contexts are supported, with a boolean
1-renderpass section support.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>