<p dir="auto">Some variables were not initialized correctly when parsing a style file,<br>
which lead to some surprising behaviour with flags of one config line<br>
re-used by the next if the flags field of that line was empty.</p>
<p dir="auto">This could also have lead to buffer overflows in the first line being<br>
parsed.</p>
<p dir="auto">This commit also adds some more tests for the parsing code.</p>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1076724918" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/osm2pgsql/issues/1590" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/osm2pgsql/issues/1590/hovercard" href="https://github.com/openstreetmap/osm2pgsql/issues/1590">#1590</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/osm2pgsql/pull/1592'>https://github.com/openstreetmap/osm2pgsql/pull/1592</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/commits/0b3fa706f067ea95880417602b3cdda6e6f3240d" class="commit-link">0b3fa70</a>  Fix parsing problems in style file reader</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files">12 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-ebe8a6dda90254ae93bff2dd2b6b4ccaa5421a1f78a2fc291dc7cd1969d00f07">src/taginfo.cpp</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-4461c617ceae0c7e0206622aacdf555aedd62eb129c2efb74c84fa1567bcbe0d">tests/CMakeLists.txt</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-574ca20b9c5896f324f80feb6d9545f21fb565f33a0aa993b3ce5bbcde603cc8">tests/style/comments.style</a>
    (3)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-92c7b44855c9878691f0431e475e7040455a79150f323eca5f6d9388b2273dca">tests/style/data-types.style</a>
    (4)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-246b1b8392f094039e72afaff3dc5fea367c227750fb16e5e0b2919b88265690">tests/style/empty.style</a>
    (0)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-e8b5493d47e789572ba9213d624f538d7ae573fd20478a3980cd80a264904605">tests/style/invalid-data-type.style</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-c8b899376040340a58eebff58ecec24a836f3e8113a6da7ba4bf814ea7157849">tests/style/invalid-osm-type.style</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-9373f16a996b06ae0fb87676c5cf74d7acdcb5bf15406774bc198a44ffa5a3ca">tests/style/missing.style</a>
    (5)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-4b4bb8ed3d02d28e1c7fb5655188d2052e1818c675ab26cbcdbf4470d823f3a6">tests/style/node.style</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-b6f5eff6a920be80812b315d21c7e30fb0b5d8ead7ec88916e7f4d271be0afe3">tests/style/valid.style</a>
    (12)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-f7770172d8680f04ec990064737a75243b5dae2009fb43a311f7ee5e811aedca">tests/style/way-area.style</a>
    (3)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/1592/files#diff-9fe5ab5c40c212ddad504109ef73bdc6b3dd937fa0d62eede568ea917fd22871">tests/test-output-pgsql-style-file.cpp</a>
    (231)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/1592.patch'>https://github.com/openstreetmap/osm2pgsql/pull/1592.patch</a></li>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/1592.diff'>https://github.com/openstreetmap/osm2pgsql/pull/1592.diff</a></li>
</ul>

<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/1592">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353T37JYE4H7CBFZAMWDUQ5GJ5ANCNFSM5KA7724A">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AA6353QHAULEB5ND74NU7CDUQ5GJ5A5CNFSM5KA7724KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QC4SV7A.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/1592",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1592",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>