Subject: | Coverity finding: Overlapping buffer in memory copy |
While running Coverity for Perl code:
Zlib.xs:
373 if (rot == 1) {
374 tmp = *list;
CID 104769: Overlapping buffer in memory copy (BUFFER_SIZE)
5. overlapping_buffer: The source buffer list + 1 potentially overlaps with the destination buffer list, which results in undefined behavior for memcpy.
Use memmove instead of memcpy.
375 memcpy(list, list + 1, len - 1);
376 *last = tmp;