commit | 55b5b7a646589f2eb3b77ab4f58ccc1d2b010727 | [log] [tgz] |
---|---|---|
author | Nicolas Iooss <nicolas.iooss@m4x.org> | Fri Apr 07 22:44:26 2017 +0200 |
committer | Stephen Smalley <sds@tycho.nsa.gov> | Tue Apr 11 14:19:52 2017 -0400 |
tree | 1b920bcdf9ad184491e3deec57dcbfc7396fafda | |
parent | 682e01f79db6f175996be029319154b2600f40c3 [diff] |
libselinux: do not dereference a NULL pointer when calloc() fails selabel_is_digest_set() contains the following code: digest = calloc(1, sizeof(*digest)); if (!digest) goto err; /* ... */ err: free(digest->digest); If calloc() failed, digest is NULL but is dereferenced when the execution jumps to label err. Check that digest is not NULL before freeing its fields. This issue has been found using clang's static analyzer. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>