<div dir="ltr"><div>As far as I can see such kind of issues can easily be detected by a static code analyzer tool like this: <a href="https://sonarcloud.io/">https://sonarcloud.io/</a></div><div>This seems to be free of use for any open source projects.</div><div><br></div><div>What do you think using such tools regularly as part of the continuous integration?</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div><div><br></div><div> </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Tamas Szekeres <<a href="mailto:szekerest@gmail.com">szekerest@gmail.com</a>> ezt írta (időpont: 2022. febr. 12., Szo, 21:26):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Even,<div><br></div><div>Thank you for the fix. I agree that assert does have it's own purpose (when debugging), but the code should never expect that assert will do anything to prevent the code to continue the execution (like what throwing an exception would do). So dereferencing a null pointer in the subsequent code without checking the pointer against null is prohibited.</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> ezt írta (időpont: 2022. febr. 12., Szo, 20:25):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hopefully <a href="https://github.com/MapServer/MapServer/pull/6477" target="_blank">https://github.com/MapServer/MapServer/pull/6477</a> should
fix that</p>
<p>to use or not to use assert(), and where, is one of the many
debates for which devs will have different opinions :
<a href="https://stackoverflow.com/questions/1081409/why-should-i-use-asserts" target="_blank">https://stackoverflow.com/questions/1081409/why-should-i-use-asserts</a>
. I'd say assert() are supposed to be used for conditions you
don't anticipate to happen in practice and thus for which you
don't have a plan if they occur (a good reason is because you
can't test it and thus the error handling might be broken because
untested). Of course practice sometimes/often later contradicts
your theories, as the impossible has a trend to occur more often
than you'd like :-)</p>
<p>Even<br>
</p>
<div>Le 12/02/2022 à 19:49, Steve Lime a
écrit :<br>
</div>
<blockquote type="cite"><i><font color="#ff0000">ert( layer->layerinfo != N</font></i></blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
_______________________________________________<br>
MapServer-dev mailing list<br>
<a href="mailto:MapServer-dev@lists.osgeo.org" target="_blank">MapServer-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</blockquote></div>
</blockquote></div></div>