diff options
author | David Sterba <dsterba@suse.cz> | 2015-01-03 03:10:55 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-01-03 03:22:19 +0100 |
commit | 190e916dfc09efd1c49463d423f1cede6c32a45d (patch) | |
tree | 1f64ab270bac7001035df00f18774f3ec239ff15 | |
parent | fd1e9ad6a89b9b24a601d85b68c7a616f63ef0a7 (diff) | |
download | btrfs-progs-190e916dfc09efd1c49463d423f1cede6c32a45d.tar.gz |
btrfs-progs: use strncpy in is_same_blk_file
Although we're getting strings from the caller, let's be safe.
Resolves-coverity-id: 1199475
Signed-off-by: David Sterba <dsterba@suse.cz>
-rw-r--r-- | utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1005,11 +1005,11 @@ static int is_same_blk_file(const char* a, const char* b) char real_a[PATH_MAX]; char real_b[PATH_MAX]; - if(!realpath(a, real_a)) - strcpy(real_a, a); + if (!realpath(a, real_a)) + strncpy_null(real_a, a); if (!realpath(b, real_b)) - strcpy(real_b, b); + strncpy_null(real_b, b); /* Identical path? */ if(strcmp(real_a, real_b) == 0) |