Skip to content

Commit

Permalink
Fix for ArcIMS service parser to prevent deadlock with certain malfor…
Browse files Browse the repository at this point in the history
…med inputs
  • Loading branch information
chris committed Aug 26, 2009
1 parent 8ddbe01 commit 2eedce1
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Dapple/Phoenix/Model/ArcIMSModelNodes.cs
Expand Up @@ -466,6 +466,12 @@ internal ArcIMSFeatureCoordSys CoordinateSystem

protected override ModelNode[] Load()
{
NumberStyles parseStyle =
NumberStyles.AllowDecimalPoint |
NumberStyles.AllowLeadingSign |
NumberStyles.AllowLeadingWhite |
NumberStyles.AllowTrailingWhite;

String strServiceFilename = CapabilitiesFilename;

ArcIMSServiceDownload oServiceDownload = new ArcIMSServiceDownload((Parent as ServerModelNode).Uri as ArcIMSServerUri, m_strServiceName, 0);
Expand Down Expand Up @@ -495,10 +501,10 @@ protected override ModelNode[] Load()
{
GeographicBoundingBox oRealServiceBounds = new GeographicBoundingBox();
bool blValid = true;
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("minx"), NumberStyles.Any, m_oCultureInfo, out oRealServiceBounds.West);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("miny"), NumberStyles.Any, m_oCultureInfo, out oRealServiceBounds.South);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("maxx"), NumberStyles.Any, m_oCultureInfo, out oRealServiceBounds.East);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("maxy"), NumberStyles.Any, m_oCultureInfo, out oRealServiceBounds.North);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("minx"), parseStyle, m_oCultureInfo, out oRealServiceBounds.West);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("miny"), parseStyle, m_oCultureInfo, out oRealServiceBounds.South);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("maxx"), parseStyle, m_oCultureInfo, out oRealServiceBounds.East);
blValid &= Double.TryParse(oServiceEnvelope.GetAttribute("maxy"), parseStyle, m_oCultureInfo, out oRealServiceBounds.North);

if (blValid)
oServiceBounds = oRealServiceBounds;
Expand Down Expand Up @@ -546,10 +552,10 @@ protected override ModelNode[] Load()
{
GeographicBoundingBox oRealLayerBounds = new GeographicBoundingBox();
bool blValid = true;
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("minx"), NumberStyles.Any, m_oCultureInfo, out oRealLayerBounds.West);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("miny"), NumberStyles.Any, m_oCultureInfo, out oRealLayerBounds.South);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("maxx"), NumberStyles.Any, m_oCultureInfo, out oRealLayerBounds.East);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("maxy"), NumberStyles.Any, m_oCultureInfo, out oRealLayerBounds.North);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("minx"), parseStyle, m_oCultureInfo, out oRealLayerBounds.West);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("miny"), parseStyle, m_oCultureInfo, out oRealLayerBounds.South);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("maxx"), parseStyle, m_oCultureInfo, out oRealLayerBounds.East);
blValid &= Double.TryParse(oLayerEnvelope.GetAttribute("maxy"), parseStyle, m_oCultureInfo, out oRealLayerBounds.North);
if (blValid)
oLayerBounds = oRealLayerBounds;
}
Expand Down

0 comments on commit 2eedce1

Please sign in to comment.