[Tile-serving] [osm2pgsql] Core dump with test files (#298)

Paul Norman notifications at github.com
Sat Feb 21 18:48:18 UTC 2015


https://github.com/openstreetmap/osm2pgsql/blob/master/pgsql.cpp#L44 looks vaguly familiar 
```c++
boost::shared_ptr<PGresult> pgsql_exec_simple(PGconn *sql_conn, const ExecStatusType expect, const char *sql)
{
PGresult* res;
res = PQexec(sql_conn, sql);
if (PQresultStatus(res) != expect) {
PQclear(res);
throw std::runtime_error((boost::format("%1% failed: %2%\n") % sql % PQerrorMessage(sql_conn)).str());
}
return boost::shared_ptr<PGresult>(res, &PQclear);
}
```

Do we have any guarantee that sql_conn is what we expect when we're throwing the error? I recall seeing this come up elsewhere with the C++ conversion before

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/298#issuecomment-75386046
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150221/9cd0e6a5/attachment.html>


More information about the Tile-serving mailing list