The problem is you're relying upon undefined behaviour for memcpy(3):

    size_t skip = strlen(other);

    ssize_t index = 1;
    ssize_t next = 87;
    size_t tail = 1;

    memcpy(buf + tail, buf + index + skip, next - index - skip);

The memory areas overlap, which invokes the undefined behaviour; see the
standard definition here
http://pubs.opengroup.org/onlinepubs/009695399/functions/memcpy.html and
a common manpage used for the glibc implementation here
http://man7.org/linux/man-pages/man3/memcpy.3.html

If you wish to use overlapping source and destination, then you should
use memmove(3) instead.

Thanks

** Changed in: glibc (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1441421

Title:
  compatibility issue in libc6:i386

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1441421/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to