commit:     5000f8ea9c3519fc4e028ab050a58b1f314b2633
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 20 03:07:12 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Jun 20 03:07:12 2016 +0000
URL:        https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=5000f8ea

scanelf: use strcpy to make coverity happy

We know ret is always 7 bytes, and pax_short_hf_flags always returns 7
bytes (including a NUL terminator), so use strcpy to keep coverity from
throwing a warning about missing NUL.

 scanelf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scanelf.c b/scanelf.c
index 1f3e356..42fe4c5 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -391,7 +391,7 @@ static char *scanelf_file_pax(elfobj *elf, char *found_pax)
                        *found_pax = 1;
                        return (be_wewy_wewy_quiet ? NULL : paxflags);
                }
-               strncpy(ret, paxflags, sizeof(ret));
+               strcpy(ret, paxflags);
        }
 
        if (be_wewy_wewy_quiet || (be_quiet && !shown))

Reply via email to