Skip to content

Commit 5fdb142

Browse files
committed
Tweak ArrayCount() to forestall possible access to temp[-1]. Problem
cannot actually happen at present because ArrayCount() is only called on strings beginning with '{', but seems best to prevent it going forward. Per report from Yichen Xie.
1 parent 3cb282f commit 5fdb142

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/arrayfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.85 2002/11/13 00:39:47 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.86 2003/01/29 01:28:33 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -275,7 +275,7 @@ ArrayCount(char *str, int *dim, char typdelim)
275275
{
276276
int nest_level = 0,
277277
i;
278-
int ndim = 0,
278+
int ndim = 1,
279279
temp[MAXDIM];
280280
bool scanning_string = false;
281281
bool eoArray = false;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy