diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-02-03 13:19:07 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-02-03 13:19:07 -0500 |
commit | 17f913e4652ac44bd811c7dbcc285a565b2d251d (patch) | |
tree | 2394f0f6b0cbe90a7b85ec988904e80af649d45f /pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch | |
parent | d9fecb8ab0f52272fd4785fe6f15e6855b2f6008 (diff) | |
download | abslibre-17f913e4652ac44bd811c7dbcc285a565b2d251d.tar.gz abslibre-17f913e4652ac44bd811c7dbcc285a565b2d251d.tar.bz2 abslibre-17f913e4652ac44bd811c7dbcc285a565b2d251d.zip |
add pcr/libselinux
Diffstat (limited to 'pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch')
-rw-r--r-- | pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch b/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch new file mode 100644 index 000000000..28da417a2 --- /dev/null +++ b/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch @@ -0,0 +1,37 @@ +From 550c0122ee22c5c41bba6cd1ddd5a71529610ada Mon Sep 17 00:00:00 2001 +From: vmojzis <vmojzis@redhat.com> +Date: Thu, 27 Oct 2016 13:52:36 +0200 +Subject: [PATCH] libselinux: fix pointer handling in realpath_not_final + +Loop designed for stripping leading "//" was changing +the only pointer referencing block of memory allocated +by "strdup", resulting in "free()" failure. The loop +had no effect because "realpath" is used later on. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1376598 + +Signed-off-by: vmojzis <vmojzis@redhat.com> +--- + libselinux/src/matchpathcon.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c +index 724eb65097d6..58b4144ac0bf 100644 +--- a/libselinux/src/matchpathcon.c ++++ b/libselinux/src/matchpathcon.c +@@ -389,12 +389,6 @@ int realpath_not_final(const char *name, char *resolved_path) + goto out; + } + +- /* strip leading // */ +- while (tmp_path[len] && tmp_path[len] == '/' && +- tmp_path[len+1] && tmp_path[len+1] == '/') { +- tmp_path++; +- len++; +- } + last_component = strrchr(tmp_path, '/'); + + if (last_component == tmp_path) { +-- +2.10.2 + |