Go to file
Eric Paris 5c0d7113de policycoreutils: sestatus: rewrite to shut up coverity
The code did:

len = strlen(string);
new_string = malloc(len);
strncpy(new_string, string, len - 1)

Which is perfectly legal, but it pissed off coverity because 99/100
times if you do new_string = malloc(strlen(string)) you are doing it
wrong (you didn't leave room for the nul).  I rewrote that area to just
use strdup and then to blank out the last character with a nul.  It's
clear what's going on and nothing looks 'tricky'.  It does cost us 1
byte of heap allocation.  I think we can live with that to have safer
looking string handling code.

Signed-off-by: Eric Paris <eparis@redhat.com>
2013-02-05 20:21:51 -05:00
checkpolicy checkpolicy: Free allocated memory when clean up / exit. 2013-02-05 20:14:50 -05:00
libselinux libselinux: do not leak file contexts with mmap'd backend 2013-02-05 20:14:48 -05:00
libsemanage libsemanage: semanage_store: do not leak memory in semanage_exec_prog 2013-02-05 20:19:05 -05:00
libsepol libsepol: Fix memory leak issues found by Klocwork 2013-02-05 20:14:50 -05:00
policycoreutils policycoreutils: sestatus: rewrite to shut up coverity 2013-02-05 20:21:51 -05:00
scripts scripts: release: do not complain if release dir exists 2013-02-05 20:19:03 -05:00
sepolgen sepolgen: understand role attributes 2013-02-05 20:14:47 -05:00
.gitignore global: gitignore: add a couple of more editor backup filetypes 2013-02-01 12:14:57 -05:00
Makefile libselinux: additional makefile support for rubywrap 2012-06-28 11:21:16 -04:00