summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:02:43 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 12:02:43 +0100
commitf9abcbb71b683d98bf0658945b5fb0cf05a3b790 (patch)
tree1d69a48fc9334ea6a69e735b76d82df470508ee6 /src
parent407520464f0ef225a17e4ec025ba2503df231e5b (diff)
set_part_name_chomp: fix potential off-by-one in set_part_name_chomp()
Diffstat (limited to 'src')
-rw-r--r--src/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index f013d51..22e8511 100644
--- a/src/common.c
+++ b/src/common.c
@@ -196,7 +196,7 @@ void set_part_name(partition_t *partition,const char *src,const int max_size)
void set_part_name_chomp(partition_t *partition, const unsigned char *src, const int max_size)
{
int i;
- for(i=0; i<sizeof(partition->fsname) && i<max_size && src[i]!='\0'; i++)
+ for(i=0; i<sizeof(partition->fsname)-1 && i<max_size && src[i]!='\0'; i++)
partition->fsname[i]=src[i];
partition->fsname[i]='\0';
for(i--; i>=0 && src[i]==' '; i--);