Re: fix memcpy() overlap

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix memcpy() overlap
Date: 2004-02-02 21:23:15
Message-ID: 20040202132041.M61426@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


On Mon, 2 Feb 2004, Tom Lane wrote:

> Neil Conway <neilc(at)samurai(dot)com> writes:
> > I don't know of a memcpy() implementation that would actually bail out
> > if called with two equal pointers, but perhaps there is one in
> > existence somewhere.
>
> This isn't a bug, and I see no reason to clutter the code just to shut
> up valgrind.

Isn't memcpy on overlapping (even entirely overlapping) buffers undefined
behavior unless the count is 0?

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Nicolai Tufar 2004-02-02 21:25:30 Re: C locale sort in src/tools/make_ctags - solved
Previous Message Tom Lane 2004-02-02 20:59:04 Re: fix memcpy() overlap