[Open-scap] Patch for TODOs

Peter Vrabec pvrabec at redhat.com
Thu Jul 30 15:21:16 UTC 2009


On Thursday 30 July 2009 04:59:12 pm David Niemoller wrote:
> Whoops!  I am not able to reproduce the crash.  The cause may be that my
> code base is not synched with yours despite my efforts and the TODO
> patch failed against your code base.  I'm including the code that I'm
> actually running (this includes my TODO patch).  Could you test this and
> determine whether it has the same problem?
Same problem :(


Please take a look at:
oval_variableBinding.c:oval_variable_binding_parse_tag()
...
char* variableId = xmlTextReaderGetAttribute(reader, BAD_CAST "variable_id");
 struct oval_variable *variable = get_oval_variable_new(context->model, 
variableId);
set_oval_variable_binding_variable(binding, variable);
free(variableId);
....

but  variableId is freed in 
oval_agent.c:get_oval_variable_new()
struct oval_state *state = get_oval_state(model, id);
if (state == NULL) {
	state = oval_state_new();
	set_oval_state_id(state, id);
	add_oval_state(model, state);
} else {
	free(id);
}


I have attached system-characteristics.xml file that we parse.

> -----Original Message-----
> From: Peter Vrabec [mailto:pvrabec at redhat.com]
> Sent: Thursday, July 30, 2009 10:36 AM
> To: open-scap-list at redhat.com
> Cc: David Niemoller
> Subject: Re: [Open-scap] Patch for TODOs
>
> Hi David,
>
> thnx. for update. But unfortunately it breaks populating of system
> characteristic. :)
>
> $make check
> ....
> + ./test_syschar ./OVAL/composed-oval.xml
> ./OVAL/system-characteristics.xml
>
> START
>
> LOAD OVAL DEFINITIONS
>
> OVAL DEFINITIONS LOADED
>
> LOAD OVAL SYSCHAR
>
> *** glibc detected ***
> /home/pvrabec/openscap/examples/.libs/lt-test_syschar:
> double free or corruption (fasttop): 0x0000000002504200 ***
>
> ======= Backtrace: =========
>
> /lib64/libc.so.6[0x3efd875a26]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(oval_variable_binding_
> parse_tag+0x6c)
> [0x7f4bd9ab31ac]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(_oval_syschar_parse_su
> btag+0x135)
> [0x7f4bd9ab1c65]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(oval_parser_parse_tag+
> 0xa4)
> [0x7f4bd9aae524]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(oval_syschar_parse_tag
> +0x236)
> [0x7f4bd9ab1a36]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(oval_parser_parse_tag+
> 0xa4)
> [0x7f4bd9aae524]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(_ovalsys_parser_proces
> s_node+0x264)
> [0x7f4bd9ab35c4]
>
> /home/pvrabec/openscap/src/.libs/libopenscap.so.0(ovalsys_parser_parse+0
> x15b)
> [0x7f4bd9ab373b]
> ...
>
> On Thursday 30 July 2009 03:39:29 pm David Niemoller wrote:
> > Please find attached some source updates that address several of TODOs
> > in the current code base.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sys_char.zip
Type: application/zip
Size: 10347 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/open-scap-list/attachments/20090730/e69ac28e/attachment.zip>


More information about the Open-scap-list mailing list