Re: Memory leak in corbaString.cc
Duncan Grisby via omniORB-list <[email protected]> Fri, 27 Jan 2023 10:09:28 +0000
| Newsgroups | gmane.comp.corba.omniorb.user |
|---|---|
| Message-ID | <[email protected]> |
Wow, that's a very long-standing bug. Thank you for reporting it! Out of interest, how did you encounter it? Is there a real CORBA implementation that is failing to null-terminate raw strings, or were you actively looking for that kind of bug by violating the protocol or with static analysis? Thanks, Duncan. On Fri, 2023-01-27 at 07:02 +0000, 姜 维 via omniORB-list wrote: > > Index: src/lib/omniORB/orbcore/corbaString.cc > =================================================================== > --- src/lib/omniORB/orbcore/corbaString.cc (版本 6632) > +++ src/lib/omniORB/orbcore/corbaString.cc (工作副本) > @@ -80,14 +80,14 @@ > OMNIORB_THROW(MARSHAL, MARSHAL_PassEndOfMessage, > (CORBA::CompletionStatus)completion()); > > - char* s = _CORBA_String_helper::alloc(len - 1); > - get_octet_array((_CORBA_Octet*)s, len); > + _CORBA_String_var s = _CORBA_String_helper::alloc(len - 1); > + get_octet_array((_CORBA_Octet*)s.inout(), len); > > if (s[len-1] != '\0') > OMNIORB_THROW(MARSHAL,MARSHAL_StringNotEndWithNull, > (CORBA::CompletionStatus)completion()); > > - return s; > + return s._retn(); > } > > #ifndef Swap32 > > _______________________________________________ > omniORB-list mailing list > [email protected] > https://www.omniorb-support.com/mailman/listinfo/omniorb-list -- -- Duncan Grisby -- -- [email protected] -- -- http://www.grisby.org -- _______________________________________________ omniORB-list mailing list [email protected] https://www.omniorb-support.com/mailman/listinfo/omniorb-list