Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234101
b: refs/heads/master
c: 1eafbfe
h: refs/heads/master
i:
  234099: e5af757
v: v3
  • Loading branch information
Timo Warns authored and Linus Torvalds committed Mar 14, 2011
1 parent eda4e01 commit a9f1942
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fbfac4e053861925fa3fffcdc327649b09af54c
refs/heads/master: 1eafbfeb7bdf59cfe173304c76188f3fd5f1fd05
12 changes: 10 additions & 2 deletions trunk/fs/partitions/osf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
#include "check.h"
#include "osf.h"

#define MAX_OSF_PARTITIONS 8

int osf_partition(struct parsed_partitions *state)
{
int i;
int slot = 1;
unsigned int npartitions;
Sector sect;
unsigned char *data;
struct disklabel {
Expand Down Expand Up @@ -45,7 +48,7 @@ int osf_partition(struct parsed_partitions *state)
u8 p_fstype;
u8 p_frag;
__le16 p_cpg;
} d_partitions[8];
} d_partitions[MAX_OSF_PARTITIONS];
} * label;
struct d_partition * partition;

Expand All @@ -63,7 +66,12 @@ int osf_partition(struct parsed_partitions *state)
put_dev_sector(sect);
return 0;
}
for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {
npartitions = le16_to_cpu(label->d_npartitions);
if (npartitions > MAX_OSF_PARTITIONS) {
put_dev_sector(sect);
return 0;
}
for (i = 0 ; i < npartitions; i++, partition++) {
if (slot == state->limit)
break;
if (le32_to_cpu(partition->p_size))
Expand Down

0 comments on commit a9f1942

Please sign in to comment.