platform_external_selinux/libsemanage
Petr Lautrbach d003c4bad4 libsemanage: Fix USE_AFTER_FREE (CWE-672) in semanage_direct_write_langext()
>From fclose(3):
Upon successful completion, 0 is returned.  Otherwise, EOF is returned
and errno is set to indicate the error. In either case, any further
access (including another call to fclose()) to the stream results in
undefined behavior.

Fixes:
    Error: USE_AFTER_FREE (CWE-672): [#def1]
    libsemanage-3.2/src/direct_api.c:1023: freed_arg: "fclose" frees "fp".
    libsemanage-3.2/src/direct_api.c:1034: use_closed_file: Calling "fclose" uses file handle "fp" after closing it.
    # 1032|
    # 1033|   cleanup:
    # 1034|-> 	if (fp != NULL) fclose(fp);
    # 1035|
    # 1036|   	return ret;

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
2021-07-28 14:23:54 -04:00
..
example Author: Daniel J Walsh 2008-09-15 09:25:33 -04:00
include libsemanage: Remove legacy and duplicate symbols 2020-10-19 22:11:40 +02:00
man libsemanage: clarify handle-unknown configuration setting in man page 2020-04-28 09:27:49 +02:00
src libsemanage: Fix USE_AFTER_FREE (CWE-672) in semanage_direct_write_langext() 2021-07-28 14:23:54 -04:00
tests libsemanage: silence -Wextra-semi-stmt warning 2021-07-06 11:08:11 -04:00
utils Always use /usr/bin/python3 in Python scripts 2019-02-20 16:43:27 +01:00
.gitignore Add subdirectory .gitignore files. 2009-10-20 21:25:55 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libsemanage: semanage store migration script 2014-08-26 08:03:31 -04:00
VERSION Update VERSIONs to 3.2 for release. 2021-03-04 16:42:59 +01:00