Discussion:
[m-dev.] Possible NULL pointer dereference in Mercury ODBC library
Keri Harris
2017-09-26 15:46:25 UTC
Permalink
Hi,

When compiling the Mercury ODBC library (extras/odbc) I get the
following warning:

odbc.m: In function 'odbc_do_cleanup_statement':
odbc.m:1695:14: warning: the comparison will always evaluate as 'true'
for the address of 'stat' will never be NULL [-Waddress]
if (stat != NULL) {
^
This looks like it's due to a typo (stat vs statement) and could
possibly lead to a NULL pointer dereference. The attached patch
addresses this.


Thanks

Keri
Julien Fischer
2017-09-27 05:45:32 UTC
Permalink
Hi Keri,
When compiling the Mercury ODBC library (extras/odbc) I get the following
odbc.m:1695:14: warning: the comparison will always evaluate as 'true' for
the address of 'stat' will never be NULL [-Waddress]
if (stat != NULL) {
^
This looks like it's due to a typo (stat vs statement) and could possibly
lead to a NULL pointer dereference. The attached patch addresses this.
It looks like we replaced stat with statement in the C code back in
commit 749c6da and missed a spot.

I'll apply the patch -- thanks for pointing that out!

Cheers,
Julien.

Loading...