~ubuntu-branches/ubuntu/maverick/gnutls26/maverick-updates

« back to all changes in this revision

Viewing changes to lgl/memmove.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2009-08-14 19:14:29 UTC
  • mfrom: (1.1.7 upstream) (12.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090814191429-6hovzz3oaqq101rm
Tags: 2.8.3-1
* New upstream version.
  + Stops hardcoding a hard dependency on the versions of gcrypt and tasn it
    was built against. Closes: #540449
  + Fixes CVE-2009-2730, a vulnerability related to NUL bytes in X.509
    certificate name fields. Closes: #541439        GNUTLS-SA-2009-4
    http://lists.gnu.org/archive/html/help-gnutls/2009-08/msg00011.html
* Drop 15_chainverify_expiredcert.diff, included upstream.
* Urgency high, since 541439 applies to testing, too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* memmove.c -- copy memory.
2
 
   Copy LENGTH bytes from SOURCE to DEST.  Does not null-terminate.
3
 
   In the public domain.
4
 
   By David MacKenzie <djm@gnu.ai.mit.edu>.  */
5
 
 
6
 
#include <config.h>
7
 
 
8
 
#include <stddef.h>
9
 
 
10
 
void *
11
 
memmove (void *dest0, void const *source0, size_t length)
12
 
{
13
 
  char *dest = dest0;
14
 
  char const *source = source0;
15
 
  if (source < dest)
16
 
    /* Moving from low mem to hi mem; start at end.  */
17
 
    for (source += length, dest += length; length; --length)
18
 
      *--dest = *--source;
19
 
  else if (source != dest)
20
 
    {
21
 
      /* Moving from hi mem to low mem; start at beginning.  */
22
 
      for (; length; --length)
23
 
        *dest++ = *source++;
24
 
    }
25
 
  return dest0;
26
 
}