PostGIS: Ticket #1179: st_astext crash with bad value <p> When copying and pasting a value to put into st_astext, I accidentally got a newline character in there and it resulted in a server crash. It crashed trying to put together the error message because the error location was not set properly. </p> <p> This is with postgis 1.5 SVN running against 9.1rc1 server on x86_64 linux. </p> <p> Here's the test case: SELECT st_astext('<a class="missing changeset" rel="nofollow" title="No changeset 0101000020AD100000C85D698D889A5D in the repository">0101000020AD100000C85D698D889A5D</a>\nC09EF3C3134FF54040'); </p> <p> Attached is a patch which does a couple of things: </p> <p> 1) Initializes the error location to zero so we don't crash if it doesn't get set later on. </p> <p> 2) Changes the LWGEOM_WKB_PARSER_ERROR macro to assign the error location. </p> <p> 3) Changes the current position location calculation in strhex_readbyte to correctly track it. We're reading two characters at a time here, not one. </p> en-us PostGIS Trac 1.2.2 kjurka Mon, 05 Sep 2011 18:04:52 GMT attachment set <ul> <li><strong>attachment</strong> set to <em>parse-failure.patch</em> </li> </ul> Ticket kjurka Mon, 05 Sep 2011 18:05:06 GMT attachment set <ul> <li><strong>attachment</strong> set to <em>stacktrace.txt</em> </li> </ul> Ticket pramsey Mon, 05 Sep 2011 23:50:07 GMT status changed; resolution set <ul> <li><strong>status</strong> changed from <em>new</em> to <em>closed</em> </li> <li><strong>resolution</strong> set to <em>fixed</em> </li> </ul> <p> Confirmed, doesn't crash for me on OSX, but does give me a bogus error location, so I can see how others might get worse failures. I've applied this to 1.5 branch. </p> Ticket