<p><b>@lonvia</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/956#discussion_r330626022">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>The recommendation (in the BUG section of scanf. Who reads that far down? ;) ) is '%18lld' (and <code>long long</code>). Can you try that? If it doesn't work either, then we have to go the <code>strtol</code> route. I can help out in that case.</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=AA6353XLL2MEFI6SSYQ6BCLQMS6PDA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGU4HYY#discussion_r330626022">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353UWR6RW6T4JM35RPGTQMS6PDANCNFSM4I3YC4KA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AA6353RDZNNBGEP6SEM5WTDQMS6PDA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGU4HYY.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=AA6353XLL2MEFI6SSYQ6BCLQMS6PDA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGU4HYY#discussion_r330626022",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/956?email_source=notifications\u0026email_token=AA6353XLL2MEFI6SSYQ6BCLQMS6PDA5CNFSM4I3YC4KKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCGU4HYY#discussion_r330626022",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>