Possible integer underflow: left operand is tainted.
An integer underflow may occur due to arithmetic operation (unsigned subtraction) between values { [0,
4294967295] } and '1',
where the first value comes from the expression 'strlen(*worditer)'
Change-Id: I6664af6907644f34e5225fff91dca5209f55eaf0
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
const char *text;
struct bench bench;
char *elapsed;
+ size_t word_len;
darray_init(words);
file = fopen("/usr/share/dict/words", "rb");
assert(table);
darray_foreach(worditer, words) {
- atom = atom_intern(table, *worditer, strlen(*worditer) - 1, true);
+ word_len = strlen(*worditer) > 0 ? strlen(*worditer) - 1 : 0;
+ atom = atom_intern(table, *worditer, word_len, true);
assert(atom != XKB_ATOM_NONE);
text = atom_text(table, atom);