You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jo...@apache.org on 2009/01/16 13:46:25 UTC

svn commit: r734991 - in /xerces/c/trunk/src/xercesc/util/NetAccessors: Socket/UnixHTTPURLInputStream.cpp WinSock/BinHTTPURLInputStream.cpp

Author: johns
Date: Fri Jan 16 04:46:25 2009
New Revision: 734991

URL: http://svn.apache.org/viewvc?rev=734991&view=rev
Log:
Fix a bug in the socket and winsock net accessors when a redirection response does not contain a "Location" header.

Modified:
    xerces/c/trunk/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp
    xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp

Modified: xerces/c/trunk/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp?rev=734991&r1=734990&r2=734991&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp Fri Jan 16 04:46:25 2009
@@ -206,6 +206,10 @@
             XMLCh *newURLString = findHeader("Location");
             ArrayJanitor<XMLCh> janNewURLString(newURLString, memoryManager);
 
+            if(newURLString == 0 || *newURLString == 0) {
+                ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::File_CouldNotOpenFile, url.getURLText(), memoryManager);
+            }
+
             XMLURL newURL(memoryManager);
             newURL.setURL(url, newURLString);
             if(newURL.getProtocol() != XMLURL::HTTP) {

Modified: xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp?rev=734991&r1=734990&r2=734991&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp Fri Jan 16 04:46:25 2009
@@ -426,6 +426,10 @@
             XMLCh *newURLString = findHeader("Location");
             ArrayJanitor<XMLCh> janNewURLString(newURLString, memoryManager);
 
+            if(newURLString == 0 || *newURLString == 0) {
+                ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::File_CouldNotOpenFile, url.getURLText(), memoryManager);
+            }
+
             XMLURL newURL(memoryManager);
             newURL.setURL(url, newURLString);
             if(newURL.getProtocol() != XMLURL::HTTP) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org