diff options
author | Dan Carpenter <[email protected]> | 2012-03-15 14:37:32 +0300 |
---|---|---|
committer | Anton Vorontsov <[email protected]> | 2012-05-04 19:24:48 -0700 |
commit | 1ef3d8fb4deb77ee020b246d217dd4dfb28d88d5 (patch) | |
tree | 13613ae086b2270373532db8490e011c7a0eb259 /net/lapb/lapb_out.c | |
parent | 69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff) |
max17042_battery: Fix a couple buffer overflows
There are a couple issues here caused by confusion between sizeof()
and ARRAY_SIZE(). "table_size" should be the number of elements, but we
should allocate it with kcalloc() so that we allocate the correct number
of bytes.
In max17042_init_model() we don't allocate enough space so we go past
the end of the array in max17042_read_model_data() and
max17042_model_data_compare().
In max17042_verify_model_lock() we allocate the right amount of space
but we call max17042_read_model_data() with the wrong number of elements
and also in the for loop we go past the end of the array.
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Dirk Brandewie <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions