Browse Source

livetree: fix off-by-one in propval_cell_n() bounds check

Signed-off-by: Johannes Beisswenger <johannes.beisswenger@cetitec.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Johannes Beisswenger 2 years ago committed by David Gibson
parent
commit
b2b9671583
  1. 2
      livetree.c

2
livetree.c

@ -441,7 +441,7 @@ cell_t propval_cell(struct property *prop)


cell_t propval_cell_n(struct property *prop, unsigned int n) cell_t propval_cell_n(struct property *prop, unsigned int n)
{ {
assert(prop->val.len / sizeof(cell_t) >= n); assert(prop->val.len / sizeof(cell_t) > n);
return fdt32_to_cpu(*((fdt32_t *)prop->val.val + n)); return fdt32_to_cpu(*((fdt32_t *)prop->val.val + n));
} }



Loading…
Cancel
Save