HomeFreeBSD

Fix build break by "Implement Redacted Send/Receive"

Description

Fix build break by "Implement Redacted Send/Receive"

30af21b025 broke build on Fedora. gcc can detect potential overflow
on compile-time. Consider strlen of already copied string.

Also change strn to strl variants per suggestion from @behlendorf
and @ofaaland.

--

libzfs_input_check.c: In function 'test_redact':
libzfs_input_check.c:711:2: error: 'strncat' specified bound 288 equals
destination size [-Werror=stringop-overflow=]

  strncat(bookmark, "#testbookmark", sizeof (bookmark));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #8939

Details

Provenance
kusumi.tomohiro_gmail.comAuthored on Jun 22 2019, 11:30 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jun 22 2019, 11:30 PM
Parents
rGa370182fed89: Add SCSI_PASSTHROUGH to zvols to enable UNMAP support
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGd5bf1cf179a0: Fix build break by "Implement Redacted Send/Receive" (authored by Tomohiro Kusumi <kusumi.tomohiro@gmail.com>).Jun 22 2019, 11:30 PM