summaryrefslogtreecommitdiffstats
path: root/src
authorChristophe Grenier <grenier@cgsecurity.org>2012-05-08 13:06:56 (GMT)
committer Christophe Grenier <grenier@cgsecurity.org>2012-05-08 13:06:56 (GMT)
commite18ba4731d625435ec075fbd6f4eb0f3e325d3d4 (patch) (side-by-side diff)
tree68ab12bf876a84ae307a5bc1dcc23c1c5502d54e /src
parent10b1a16e369ce6cb4c48e87367a2b0311e1420f5 (diff)
Avoid a buffer overflow in Linux Raid information reportingHEADmaster
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/md.c b/src/md.c
index 02a896e..9b30c8b 100644
--- a/src/md.c
+++ b/src/md.c
@@ -284,7 +284,7 @@ static int set_MD_info(const struct mdp_superblock_s *sb, partition_t *partition
if (le16(sb1->dev_roles[i-1]) != 0xffff)
break;
strcat(partition->info, " (");
- for (d=0; d < i && strlen(partition->info) < sizeof(partition->info) - 7; d++)
+ for (d=0; d < i && strlen(partition->info) < sizeof(partition->info) - 9; d++)
{
const int role = le16(sb1->dev_roles[d]);
if (d)
@@ -347,7 +347,7 @@ static int set_MD_info_be(const struct mdp_superblock_s *sb, partition_t *partit
if (be16(sb1->dev_roles[i-1]) != 0xffff)
break;
strcat(partition->info, " (");
- for (d=0; d < i && strlen(partition->info) < sizeof(partition->info) - 7; d++)
+ for (d=0; d < i && strlen(partition->info) < sizeof(partition->info) - 9; d++)
{
const int role = be16(sb1->dev_roles[d]);
if (d)