Hi Lubos,

I have packaged Virtuoso for openSUSE to be used by KDE's Soprano and while doing so rpmlint, the rpm checking tool, reported:
=====
I: A function overflows or underflows an array access. This could be a real error, but occasionaly this condition is also misdetected due to loop unrolling or strange pointer
   handling. So this is warning only, please review.
W: virtuoso arraysubscript sqlcost.c:1053
W: virtuoso arraysubscript string_tmpl.c:625, 633, 787, 808, 889, 910

I: Statement might be overflowing a buffer in strncat. Common mistake:
BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
   GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
E: virtuoso bufferoverflowstrncat http_client.c:414

I: Program returns random data in a function
E: virtuoso no-return-in-nonvoid-function sqlovdb.c:203, 172, 151
=====

The first one comes from a gcc warning and since the code involved in not trivial I couldn't confirm, but it appears to me the accesses are not guarded against the invalid accesses.

The second case is clearly a bug (caused by strncat() being brain-damaged API), the second thunk of the attached patch fixes that.

The third item is also from a gcc warning, it should be harmless in practice but I suggest using either the gcc noreturn attribute for gpf_notice() or using the first hunk of the attached patch.

I will review these warnings and contact you.

Patrick

Reply via email to