Bug #40455 calling mgmapi function with NULL handle causes segv
Submitted: 31 Oct 2008 14:23 Modified: 1 Nov 2008 23:12
Reporter: Jonas Oreland
Status: Closed
Category:Server: NDBAPI Severity:S3 (Non-critical)
Version:5.1.29-ndb-6.2,ndb-6.3 OS:Any
Assigned to: Jonas Oreland Target Version:

[31 Oct 2008 14:23] Jonas Oreland
Description:
calling a mgmapi-function with a null-handle causes segv,
this as it starts by resetting error code on handle *before* checking for
null

How to repeat:
see subject
found by autotest

Suggested fix:
move NULL check before reset of error
[31 Oct 2008 14:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/57556

2712 Jonas Oreland	2008-10-31
      ndb - bug#40455
[31 Oct 2008 16:19] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:jonas@mysql.com-20081031135533-yc3e9emux197tpow)
(version source revid:jonas@mysql.com-20081031135533-yc3e9emux197tpow) (pib:5)
[31 Oct 2008 16:20] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:jonas@mysql.com-20081031135533-yc3e9emux197tpow)
(version source revid:jonas@mysql.com-20081031152239-co83n006uu5w614w) (pib:5)
[1 Nov 2008 10:46] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:jonas@mysql.com-20081031135533-yc3e9emux197tpow)
(version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)
[1 Nov 2008 23:12] Jon Stephens
Documented in the NDB 6.2.17 and 6.3.19 changelogs as follows:

        The MGM API reset error codes on management server handles before
        checking them. This meant that calling an MGM API function
        with a null handle caused applications to crash.
[13 Dec 2008 0:28] Bugs System
Pushed into 6.0.9-alpha  (revid:jonas@mysql.com-20081031135533-yc3e9emux197tpow) (version
source revid:tomas.ulin@sun.com-20081209185954-9svcixh2p5hsfi6w) (pib:5)