Skip to content

uru4000: Fix integer overflow in imaging_run_state()

Seong-Joong Kim requested to merge sungjungk/libfprint:fix-int-overflow into master

Motivation:

  • When ‘buf[0]’ cannot handle more than maximum value of ‘char’ (i.e., > 127), the variable may lead to an overflow.
  • ‘img->key_number’ which has a type of ‘uint8_t’ has only been assigned to ‘buf[0]’.
  • It is probably a good idea to replace type of ‘buf[]’; from ‘char’ to ‘unsigned char’.

Modification:

  • Correct the above issue
  • Correctly declare type of the variable against overflow

Merge request reports