1
    memcpy(ints, hashes, (2 * cnt - count) * HASH_SIZE);

    for (i = 2 * cnt - count, j = 2 * cnt - count; j < cnt; i += 2, ++j) {
      cn_fast_hash(hashes[i], 64, ints + j * HASH_SIZE);
    }

Isn't there a buffer overrun? i is going over of size of hashes[].

For example - count=53, cnt=32. At j=26, i=52 buffer overrun.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
wad
  • 21
  • 1

1 Answers1

1

Isn't there a buffer overrun? i is going over of size of hashes[].

No, it wont and isn't.

At j=26, i=52 buffer overrun.

No. When j=26, i is 41, so there's no buffer overrun.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
  • Ok, you are right, thank you. But what will happened with last hashes[52]? Hashes are hashed by pairs, as 64 bytes, will it skipped or doubled somehow? – wad Feb 06 '22 at 09:26
  • i never equals 52 in this loop and example. – jtgrassie Feb 06 '22 at 18:08