From d292c12d0177e92f68af85e885d92c59bf51ca2f Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Fri, 26 Sep 2008 12:52:21 +0300 Subject: [PATCH] --- yaml --- r: 116212 b: refs/heads/master c: be2f6bd62d0d4246a9227dacbe2469e1f0eccf26 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ubifs/lpt_commit.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d5391d6a0f03..60adaae64833 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 63c300b68fd93a9fadc5e317d4d001b7a6985486 +refs/heads/master: be2f6bd62d0d4246a9227dacbe2469e1f0eccf26 diff --git a/trunk/fs/ubifs/lpt_commit.c b/trunk/fs/ubifs/lpt_commit.c index 8546865a9104..eed5a0025d63 100644 --- a/trunk/fs/ubifs/lpt_commit.c +++ b/trunk/fs/ubifs/lpt_commit.c @@ -1089,6 +1089,8 @@ static int is_a_node(struct ubifs_info *c, uint8_t *buf, int len) int pos = 0, node_type, node_len; uint16_t crc, calc_crc; + if (len < UBIFS_LPT_CRC_BYTES + (UBIFS_LPT_TYPE_BITS + 7) / 8) + return 0; node_type = ubifs_unpack_bits(&addr, &pos, UBIFS_LPT_TYPE_BITS); if (node_type == UBIFS_LPT_NOT_A_NODE) return 0;