IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2005, 9:52:48 AM (21 years ago)
Author:
desonia
Message:

modified code to not allow non-empty PS_META_MULTI nodes to be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psMetadata.c

    r3779 r3780  
    1212*  @author Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-04-28 02:45:12 $
     14*  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-04-28 19:52:48 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    266266    }
    267267
    268     // if the metadataItem is MULTI, just add the encapsulated entries
     268    // if the metadataItem is MULTI, just create a MULTI node.
    269269    if (metadataItem->type == PS_META_MULTI) {
     270        if (metadataItem->data.list == NULL || metadataItem->data.list->size > 0) {
     271            psError(PS_ERR_BAD_PARAMETER_VALUE,true,
     272                    "Specified PS_META_MULTI item is not defined properly "
     273                    "(list allocated with zero size).");
     274            return false;
     275        }
    270276
    271277        // make sure the existing entry is PS_META_MULTI
    272278        existingEntry = makeMetaMulti(mdTable,key,existingEntry);
    273279
    274         psBool status = true;
    275         // add all the items in the incoming entry to metadata
    276         psList* list = metadataItem->data.list;
    277         if (list != NULL) {
    278             psListIterator* iter = psListIteratorAlloc(list,PS_LIST_HEAD,true);
    279             psMetadataItem* listItem;
    280             while (status && (listItem=(psMetadataItem*)psListGetAndIncrement(iter)) != NULL) {
    281                 status |= psMetadataAddItem(md,listItem,location,flags);
    282             }
    283             psFree(iter);
    284         }
    285 
    286         return status; // all done.
     280        return true; // all done.
    287281    }
    288282
Note: See TracChangeset for help on using the changeset viewer.