Bounds error in LockMethodInit(). - Mailing list pgsql-hackers

From Kurt Roeckx
Subject Bounds error in LockMethodInit().
Date
Msg-id 20030815184618.GA10572@ping.be
Whole thread Raw
Responses Re: Bounds error in LockMethodInit().
List pgsql-hackers
In lmgr.c you have a static LOCKMASK LockConflicts[] with 9
elements in it.

You call LockMethodTableInit() with that pointer, and
MAX_LOCKMODES - 1 (10 - 1 = 9)

That calls LockMethodInit with the same arguments, but it does
numModes++.

So you basicly have a for loop that looks like:

for (i = 0; i < 10; i++, conflictsP++)

The last item you try to copy is conflictsP is not within the
the LockConflicts array anymore.

I have no idea what that numModes++ line is doing there.


Kurt



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Copyright (C) 1996-2002
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] 7.4Beta