[Open-scap] [PATCH] fixing extended definition segfault

Simon Lukasik slukasik at redhat.com
Fri Aug 29 02:05:08 UTC 2014


On 08/29/2014 04:01 AM, Shawn Wells wrote:
> after three days of an SCAP conference, in which multiple whiskeys were
> had, I mistyped an extended definition and crashed openscap. whoops.
> ---
>   src/OVAL/oval_probe.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/OVAL/oval_probe.c b/src/OVAL/oval_probe.c
> index 12ac4b8..16d09b8 100644
> --- a/src/OVAL/oval_probe.c
> +++ b/src/OVAL/oval_probe.c
> @@ -439,6 +439,11 @@ static int oval_probe_query_criteria(oval_probe_session_t *sess, struct oval_cri
>           case OVAL_NODETYPE_EXTENDDEF:{
>                           struct oval_definition *oval_def = oval_criteria_node_get_definition(cnode);
>   			struct oval_criteria_node *node =  oval_definition_get_criteria(oval_def);
> +			if (node == NULL) {
> +				oscap_seterr(OSCAP_EFAMILY_OSCAP, "Could not find extended definition: %s.",
> +					oval_definition_get_id(oval_def));
> +				return -1;
> +			}
>                           return oval_probe_query_criteria(sess, node);
>                   }
>                   break;
>

Wow! Merged:

https://git.fedorahosted.org/cgit/openscap.git/commit/?id=32265924e4b870022424cb3992bbd9ef1b7d0a2c

Thanks for the contribution!

-- 
Simon Lukasik
Security Technologies, Red Hat, Inc.




More information about the Open-scap-list mailing list