<p><b>@mmd-osm</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/956#discussion_r330466153">table.cpp</a>:</p>
<pre style='color:#555'>> @@ -457,12 +457,21 @@ void table_t::escape_type(const string &value, ColumnType flags)
switch (flags) {
case COLUMN_TYPE_INT: {
// For integers we take the first number, or the average if it's a-b
- long from, to;
- int items = sscanf(value.c_str(), "%ld-%ld", &from, &to);
- if (items == 1) {
+ int64_t from, to;
+ // limit number of digits parsed to avoid undefined behaviour in sscanf
+ int items = sscanf(value.c_str(), "%18ld-%18ld", &from, &to);
</pre>
<p>Unfortunately, that's not supported in C++11: <code>table.cpp:462:43: error: ISO C++11 does not support the ‘%Ld’ gnu_scanf format</code></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/956?email_source=notifications&email_token=AA6353S2Y363PLNTIYPIC63QMRWJPA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGTJ62I#discussion_r330466153">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353V46N55SQ2OJTLZMIDQMRWJPANCNFSM4I3YC4KA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AA6353XYCWZXKFI4XSRBZALQMRWJPA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGTJ62I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/956?email_source=notifications\u0026email_token=AA6353S2Y363PLNTIYPIC63QMRWJPA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGTJ62I#discussion_r330466153",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/956?email_source=notifications\u0026email_token=AA6353S2Y363PLNTIYPIC63QMRWJPA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGTJ62I#discussion_r330466153",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>