summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 10:31:53 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 08:38:46 -0700
commit2a442d1629e5405efe82b832d06f69e8d1360cc7 (patch)
treec1c230bde41135de2eb2ced811ec9eb0b69bbd15 /lib
parentef5319df8e1272f6d89e3b79e248c34f286ae049 (diff)
Fix strncat usage
This look like a typo. The intention was to use strlcat() however strncat() was used instead accidentally this may lead to a buffer overflow. This was caught by gcc -D_FORTIFY_SOURCE=2. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index c6d684c4c..95c4b3568 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -2467,7 +2467,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
*/
(void) strcpy(zc.zc_top_ds, tosnap);
(void) strcpy(zc.zc_value, tosnap);
- (void) strncat(zc.zc_value, chopprefix, sizeof (zc.zc_value));
+ (void) strlcat(zc.zc_value, chopprefix, sizeof (zc.zc_value));
free(cp);
if (!zfs_name_valid(zc.zc_value, ZFS_TYPE_SNAPSHOT)) {
zcmd_free_nvlists(&zc);