aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-04-27 18:19:28 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-04-27 18:19:28 -0400
commitad520ec4acb8f0cdb143b63519be95a9549fa826 (patch)
treef43c85e4954ff49b306294faec63dac035512107 /src
parent4c804fbdfb472cf71db33609258b8e1aaad81943 (diff)
downloadpostgresql-ad520ec4acb8f0cdb143b63519be95a9549fa826.tar.gz
postgresql-ad520ec4acb8f0cdb143b63519be95a9549fa826.zip
Use memmove() not memcpy() to slide some pointers down.
The previous coding here was formally undefined, though it seems to accidentally work on most platforms in the buildfarm. Caught by some OpenBSD platforms in which libc contains an assertion check for overlapping areas passed to memcpy(). Thomas Munro
Diffstat (limited to 'src')
-rw-r--r--src/test/isolation/isolationtester.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 2969ce9470d..908a7ce8002 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -554,8 +554,8 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
/* Remove that step from the waiting[] array. */
if (w + 1 < nwaiting)
- memcpy(&waiting[w], &waiting[w + 1],
- (nwaiting - (w + 1)) * sizeof(Step *));
+ memmove(&waiting[w], &waiting[w + 1],
+ (nwaiting - (w + 1)) * sizeof(Step *));
nwaiting--;
break;
@@ -582,8 +582,8 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
/* This one finished, too! */
errorstep[nerrorstep++] = waiting[w];
if (w + 1 < nwaiting)
- memcpy(&waiting[w], &waiting[w + 1],
- (nwaiting - (w + 1)) * sizeof(Step *));
+ memmove(&waiting[w], &waiting[w + 1],
+ (nwaiting - (w + 1)) * sizeof(Step *));
nwaiting--;
}
}
@@ -614,8 +614,8 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
{
errorstep[nerrorstep++] = waiting[w];
if (w + 1 < nwaiting)
- memcpy(&waiting[w], &waiting[w + 1],
- (nwaiting - (w + 1)) * sizeof(Step *));
+ memmove(&waiting[w], &waiting[w + 1],
+ (nwaiting - (w + 1)) * sizeof(Step *));
nwaiting--;
}
}