diff options
Diffstat (limited to 'fs/ubifs/lpt_commit.c')
-rw-r--r-- | fs/ubifs/lpt_commit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 8546865a9104..eed5a0025d63 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -1089,6 +1089,8 @@ static int is_a_node(struct ubifs_info *c, uint8_t *buf, int len) | |||
1089 | int pos = 0, node_type, node_len; | 1089 | int pos = 0, node_type, node_len; |
1090 | uint16_t crc, calc_crc; | 1090 | uint16_t crc, calc_crc; |
1091 | 1091 | ||
1092 | if (len < UBIFS_LPT_CRC_BYTES + (UBIFS_LPT_TYPE_BITS + 7) / 8) | ||
1093 | return 0; | ||
1092 | node_type = ubifs_unpack_bits(&addr, &pos, UBIFS_LPT_TYPE_BITS); | 1094 | node_type = ubifs_unpack_bits(&addr, &pos, UBIFS_LPT_TYPE_BITS); |
1093 | if (node_type == UBIFS_LPT_NOT_A_NODE) | 1095 | if (node_type == UBIFS_LPT_NOT_A_NODE) |
1094 | return 0; | 1096 | return 0; |