diff options
author | Karel Zak | 2018-07-25 11:25:33 +0200 |
---|---|---|
committer | Karel Zak | 2018-07-25 11:25:33 +0200 |
commit | f665f6e43c11d4c85c2c01d7bd5a571c082e47a4 (patch) | |
tree | 2d0c701fdabb2acf76d3f102e8850f61459dfff4 /libblkid | |
parent | docs: add note about --disable-all-programs (diff) | |
download | kernel-qcow2-util-linux-f665f6e43c11d4c85c2c01d7bd5a571c082e47a4.tar.gz kernel-qcow2-util-linux-f665f6e43c11d4c85c2c01d7bd5a571c082e47a4.tar.xz kernel-qcow2-util-linux-f665f6e43c11d4c85c2c01d7bd5a571c082e47a4.zip |
libblkid: use xstrncpy() for PT id [coverity scan]
It's probably unnecessary change as blkid_parttable_set_id() is used
by MBR code and we use proper buffer size there, but better safe than
sorry.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/partitions/partitions.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c index 4138904d4..b5f393b99 100644 --- a/libblkid/src/partitions/partitions.c +++ b/libblkid/src/partitions/partitions.c @@ -22,6 +22,7 @@ #include "partitions.h" #include "sysfs.h" +#include "strutils.h" /** * SECTION: partitions @@ -1109,7 +1110,7 @@ int blkid_parttable_set_id(blkid_parttable tab, const unsigned char *id) if (!tab) return -1; - strncpy(tab->id, (const char *) id, sizeof(tab->id)); + xstrncpy(tab->id, (const char *) id, sizeof(tab->id)); return 0; } |