[prev in list] [next in list] [prev in thread] [next in thread] 

List:       orocos-dev
Subject:    [Orocos-Dev] [Bug 851] Connecting a null port in C++ lead to segfault
From:       peter () thesourceworks ! com (Peter Soetens)
Date:       2011-09-23 15:11:12
Message-ID: 20110923151112.19237.qmail () web01-shared04 ! priorweb ! be
[Download RAW message or body]


http://bugs.orocos.org/show_bug.cgi?id=851

Peter Soetens <peter at thesourceworks.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Peter Soetens <peter at thesourceworks.com> 2011-09-23 17:11:12 CEST ---
(In reply to comment #0)
> Hi,
> 
> I just had a segfault when connecting 2 ports in C++. In InputPortInterface.cpp
> (l74) thus function is :
> 
> bool InputPortInterface::connectTo(PortInterface* other, ConnPolicy const&
> policy)
> {
> OutputPortInterface* output = dynamic_cast<OutputPortInterface*>(other);
> if (! output) {
> log(Error) << "InputPort "<< getName() <<" could not connect to "<<
> other->getName() << ": not an Output port." <<endlog();
> return false;
> }
> return output->createConnection(*this, policy);
> }
> 
> 
> so when you are stupid as me to put something null into "other" the log creates
> a segfault.
> 
> 
> I think it misses something like this at the beginning :
> 
> if (! other) {
> log(Error) << "InputPort "<< getName() <<" could not connect to a NULL
> port" <<endlog();
> return false;
> }
> 
> 
> It is the same into OutputPortInterface.cpp (l98) and following.
> 
> 
> I would have been glad to create a patch but git is not my friend tonigth :(

These functions have been updated to check for null pointers in
16c6fd96c725ca60a4e5bc5bf79aa3cf8e8f1aab

Peter

-- 
Configure bugmail: http://bugs.orocos.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic