Re: [PATCH] selinux: fix double free in selinux_parse_opts_str()

2017-03-25 Thread Casey Schaufler
On 3/24/2017 7:55 PM, Tetsuo Handa wrote: > Paul Moore wrote: >> Hi, >> >> Thank you very much for this patch, but I think we need to look a bit >> harder at this problem as it appears that many callers assume that >> selinux_parse_opts_str() cleans up after itself. Looking quickly I >> found

[PATCH 1/1] libsepol/cil: do not dereference a NULL pointer when calloc() fails

2017-03-25 Thread Nicolas Iooss
When list_init() fails to allocate a list with calloc(), it calls list_destroy() with l = NULL. This functions starts by dereferencing its argument ("(*list)->head"), which does not work well when it is NULL. This bug can be fixed by returning directly in list_init() when calloc() fails. Doing so