This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug string/16004] memcpy/strcpy: detect memory overlap and crash when error is detected


https://sourceware.org/bugzilla/show_bug.cgi?id=16004

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppluzhnikov at google dot com

--- Comment #5 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
FWIW, overlapping memcpy()ies are very common, and not always a "real" bug.
E.g.

    void *p = allocate_and_init (10);
    ...
    void *q = realloc(p, 20);  // q may or may not == p.
    memcpy(q, p, 10);

I've seen examples of "not a real bug" where p!=q as well.

While in theory these all should be fixed, in practice end users may not be in
a position to do so (e.g. prebuilt 3rd party library where the 3rd party
doesn't exist anymore, or isn't willing or able to provide a fixed version).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]