From: Nicolas Iooss <nicolas.iooss@m4x.org> To: selinux@vger.kernel.org Subject: [PATCH 1/9] semodule-utils: fix comparison with argc Date: Sun, 1 Sep 2019 20:06:28 +0200 Message-ID: <20190901180636.31586-2-nicolas.iooss@m4x.org> (raw) In-Reply-To: <20190901180636.31586-1-nicolas.iooss@m4x.org> In order for argv[3] to be used, argc needs to be at least 4, not 3. This bug was found using lgtm.com analyzer: https://lgtm.com/projects/g/fishilico/selinux-for-lgtm/snapshot/8c1b2658f80392ff8b3532c6bd5d0cefac8afb30/files/semodule-utils/semodule_package/semodule_unpackage.c?sort=name&dir=ASC&mode=heatmap#xb1ce80b43260d34c:1 Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org> --- semodule-utils/semodule_package/semodule_unpackage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semodule-utils/semodule_package/semodule_unpackage.c b/semodule-utils/semodule_package/semodule_unpackage.c index c9124c0f5ac1..b8c4fbcec434 100644 --- a/semodule-utils/semodule_package/semodule_unpackage.c +++ b/semodule-utils/semodule_package/semodule_unpackage.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) ppfile = argv[1]; modfile = argv[2]; - if (argc >= 3) + if (argc >= 4) fcfile = argv[3]; if (file_to_policy_file(ppfile, &in, "r")) -- 2.22.0
next prev parent reply index Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-01 18:06 [PATCH 0/9] Fix issues found by static analyzers Nicolas Iooss 2019-09-01 18:06 ` Nicolas Iooss [this message] 2019-09-01 18:06 ` [PATCH 2/9] libsepol/cil: help static analyzers by aborting when an allocation fails Nicolas Iooss 2019-09-10 18:48 ` [Non-DoD Source] " jwcart2 2019-09-01 18:06 ` [PATCH 3/9] libsepol: do not dereference a failed allocated pointer Nicolas Iooss 2019-09-10 18:52 ` [Non-DoD Source] " jwcart2 2019-09-10 20:11 ` jwcart2 2019-09-01 18:06 ` [PATCH 4/9] libsepol: do not dereference scope if it can be NULL Nicolas Iooss 2019-09-01 18:06 ` [PATCH 5/9] libsepol: reset *p to NULL if sepol_module_package_create fails Nicolas Iooss 2019-09-01 18:06 ` [PATCH 6/9] libsepol/cil: do not dereference perm_value_to_cil when it has not been allocated Nicolas Iooss 2019-09-01 18:06 ` [PATCH 7/9] python/chcat: remove unnecessary assignment Nicolas Iooss 2019-09-01 18:06 ` [PATCH 8/9] python/sepolicy: remove unnecessary pass statement Nicolas Iooss 2019-09-01 18:06 ` [PATCH 9/9] libsepol/tests: do not dereference a NULL pointer Nicolas Iooss 2019-09-16 16:46 ` [Non-DoD Source] [PATCH 0/9] Fix issues found by static analyzers jwcart2 2019-09-17 15:01 ` jwcart2
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190901180636.31586-2-nicolas.iooss@m4x.org \ --to=nicolas.iooss@m4x.org \ --cc=selinux@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
SELinux Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/selinux/0 selinux/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 selinux selinux/ https://lore.kernel.org/selinux \ selinux@vger.kernel.org public-inbox-index selinux Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.selinux AGPL code for this site: git clone https://public-inbox.org/public-inbox.git