opendnssec/SoftHSMv1 — pull request #6 by bellgrim (2014-01-29 14:44:09+00:00)
Title: Fix malloc(0) warning in clang.

This patch will fix the clang warning given in this output:
https://dev.sinodun.com/analysis/softhsm/

The if-statement could have looked like this:
if(!idLength || idLength % 2 != 0)

But my version of clang (3.0-6ubuntu3) still thinks that malloc(0) can happen. However, only positive even integers can pass the checks. So *newLen will always be larger or equal to one. It thinks that idLength=1 will pass the tests.

To satisfy clang, I decided to use:
if(idLength < 2 || idLength % 2 != 0)

(My version of clang will also produce two false-positives, which are not in the report from John. It has probably been fixed in the version that John is using.)