After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341336 - NULL can be dereferenced in ORBit_POAObject_handle_request
NULL can be dereferenced in ORBit_POAObject_handle_request
Status: RESOLVED FIXED
Product: ORBit2
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: ORBit maintainers
ORBit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-10 21:19 UTC by Pascal Terjan
Modified: 2006-05-20 11:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check if cleanup is needed before dereferencing poa (540 bytes, patch)
2006-05-10 21:22 UTC, Pascal Terjan
none Details | Review

Description Pascal Terjan 2006-05-10 21:19:13 UTC
(coverity #1188)

in ORBit2/src/orb/poa/poa.c :

In ORBit_POAObject_handle_request, there are tests on poa being NULL, but if it occurs to be NULL, there is a goto to some cleanup code which will dereference it. 

1384 	 clean_out:
1385 		POA_UNLOCK (poa);
1386 		ORBit_RootObject_release (poa);
1387 	}

The UNLOCK and release should be inside an if, like the LOCK and duplicate are.
Comment 1 Pascal Terjan 2006-05-10 21:22:09 UTC
Created attachment 65201 [details] [review]
Check if cleanup is needed before dereferencing poa
Comment 2 Michael Meeks 2006-05-17 14:25:49 UTC
fine - please do commit; there are other un-guarded uses of 'poa' in that method though. It's prolly best to bail early if (!poa) though - preferably add a 'goto clean_out' after the set OBJECT_NOT_EXIST path.

Thanks.
Comment 3 Pascal Terjan 2006-05-17 19:52:07 UTC
After setting ex_CORBA_OBJECT_NOT_EXIST we skip the else and get at :

        if (ev->_major != CORBA_NO_EXCEPTION) {
                return_exception (recv_buffer, m_data, ev);
                goto clean_out;
        }

so the goto will always occur and I don't think we need an explicit one before.

Regarding commit, I don't have any cvs rights :)
Comment 4 Kjartan Maraas 2006-05-18 07:27:35 UTC
Could you send a request for an account to accounts@gnome.org? I'll gladly vouch for you as would Michael I should think.
Comment 5 Kjartan Maraas 2006-05-20 11:40:58 UTC
I commited this for you.