Re: [PATCH 0/7] Fix some issues spotted by static analyzers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 26, 2018 at 08:42:06PM +0200, Nicolas Iooss wrote:
> Hi,
> As you may have noticed, I have been using clang's static analyzer for
> a few months and submitted fixes for bugs that it found. There are also
> many minor issues in the code (memory leaks, dead assignments, etc.)
> which introduce much noise and make it harder to find real issues. For
> example if a reported "dead variable assignment" is about the return
> value of a function which would need to be checked and the wrong
> variable is used in the check, this would be detected by the analyzer
> but would be in the noise of other minor issues.
> 
> Therefore this patchset (and the ones that I would like to send in the
> following weeks) is about reducing this noise.
> 
> I am starting with libsepol/src/module_to_cil.c and while cleaning up
> the commits I have written in order to use clang's static analyzer, I
> stumbled upon some other local commits I forgot to send, which fix more
> important bugs (like a missing call to va_end(), in the last patch).
> This explains why there are other files which are modified.
> 
> Here is the git shortlog:
> 
> Nicolas Iooss (7):
>   libsepol: cil: silence clang analyzer false positive
>   libsepol: do not leak memory if list_prepend fails
>   libsepol: remove some dead assignments
>   libsepol: do not call malloc with 0 byte
>   libsepol: remove unused variable
>   checkpolicy: destroy the class datum if it fails to initialize
>   libsepol: destroy the copied va_list
> 
>  checkpolicy/module_compiler.c   |  1 +
>  libsepol/cil/src/cil_tree.c     |  2 +-
>  libsepol/src/kernel_to_common.c |  3 +++
>  libsepol/src/module_to_cil.c    | 21 +++++++++++++--------
>  4 files changed, 18 insertions(+), 9 deletions(-)

These all look good to me. I didnt compile test since your CI has
already done that many many times.

For the whole series:
Acked-by: Jason Zaman <jason@xxxxxxxxxxxxx>

-- Jason

> 
> Cheers,
> Nicolas
> 
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> Selinux mailing list
> Selinux@xxxxxxxxxxxxx
> To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
> To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux