Ignore:
Timestamp:
Jan 22, 2017, 5:32:02 PM (4 years ago)
Author:
djay
Message:

Return default iotype if no value has been provided. Fix potential segfault in case tmpIoType is null.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/server_internal.c

    r798 r805  
    791791         * check for useMapServer presence
    792792         */
    793         map* tmpCheck=getMap(tmpIoType->content,"useMapServer");
    794         if(tmpCheck!=NULL){
    795           // Get the default value
    796           tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
    797           tmpCheck=getMap(tmpMaps->content,"mimeType");
    798           addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value);
    799           map* cursor=tmpIoType->content;
    800           while(cursor!=NULL){
    801             addToMap(tmpMaps->content,cursor->name,cursor->value);
    802             cursor=cursor->next;
    803           }
     793        if(tmpIoType!=NULL){
     794          map* tmpCheck=getMap(tmpIoType->content,"useMapServer");
     795          if(tmpCheck!=NULL){
     796            // Get the default value
     797            tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
     798            tmpCheck=getMap(tmpMaps->content,"mimeType");
     799            addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value);
     800            map* cursor=tmpIoType->content;
     801            while(cursor!=NULL){
     802              addToMap(tmpMaps->content,cursor->name,cursor->value);
     803              cursor=cursor->next;
     804            }
    804805         
    805           cursor=tmpInputs->content;
    806           while(cursor!=NULL){
    807             if(strcasecmp(cursor->name,"Title")==0 ||
    808                strcasecmp(cursor->name,"Abstract")==0)
    809               addToMap(tmpMaps->content,cursor->name,cursor->value);
    810            cursor=cursor->next;
     806            cursor=tmpInputs->content;
     807            while(cursor!=NULL){
     808              if(strcasecmp(cursor->name,"Title")==0 ||
     809                 strcasecmp(cursor->name,"Abstract")==0)
     810                addToMap(tmpMaps->content,cursor->name,cursor->value);
     811              cursor=cursor->next;
     812            }
    811813          }
    812814        }
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png