Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
modules/led-7seg: fix memory illegal access
Browse files Browse the repository at this point in the history
Max index was miscalculated.

Signed-off-by: Bruno Dilly <bruno.dilly@intel.com>
  • Loading branch information
bdilly committed Sep 11, 2015
1 parent 5f1d855 commit 4d1d879
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/flow/led-7seg/led-7seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ value_set(struct sol_flow_node *node, void *data, uint16_t port, uint16_t conn_i
{
int32_t in_value;
int r;
const int array_size = ARRAY_SIZE(font);
const int array_size = ARRAY_SIZE(font) - 1;

r = sol_flow_packet_get_irange_value(packet, &in_value);
SOL_INT_CHECK(r, < 0, r);


if ((in_value < 0) || (in_value > array_size)) {
sol_flow_send_error_packet(node, ERANGE,
"Range invalid, it should be between %d and %d but was %d",
Expand Down

0 comments on commit 4d1d879

Please sign in to comment.