From: Vadim B. Mikheev Date: Sat, 5 Apr 1997 03:36:21 +0000 (+0000) Subject: Check for attributeList is NULL in ConstructTupleDescriptor (). X-Git-Tag: REL6_1~366 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50faf409036d4abaf927ce210254c525a74365c7;p=postgresql Check for attributeList is NULL in ConstructTupleDescriptor (). Submitted by Raymond Toy. --- diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 9a153741ca..13f74ae199 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.14 1997/03/27 04:13:44 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.15 1997/04/05 03:36:21 vadim Exp $ * * * INTERFACE ROUTINES @@ -369,9 +369,13 @@ ConstructTupleDescriptor(Oid heapoid, if (atnum > natts) elog(WARN, "Cannot create index: attribute %d does not exist", atnum); - IndexKey = (IndexElem*) lfirst(attributeList); - attributeList = lnext(attributeList); - IndexKeyType = IndexKey->tname; + if (attributeList) { + IndexKey = (IndexElem*) lfirst(attributeList); + attributeList = lnext(attributeList); + IndexKeyType = IndexKey->tname; + } else { + IndexKeyType = NULL; + } indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);