MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031925Community[OCCT] OCCT:Foundation Classespublic2020-11-13 16:422020-11-20 12:04
Reporterkgv 
Assigned Tokgv 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformLinuxOSOS Version
Product Version[OCCT] 5.2.2 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031925: Foundation Classes, OSD_Host::InternetAddress() - possible NULL dereference on copying gethostbyname() result
Description> When writing a STEP AP203 file, the fallback value for the organization is the computer's IP address.
> This function segfaults, because gethostbyname returns a null pointer.
> OS: Linux 5.8.16
https://old.opencascade.com/content/segfault-osdhostinternetaddress#comment-21811 [^]

Backtrace:
#0  0x00007ffff6e937bd in OSD_Host::InternetAddress() () from /usr/lib/libTKernel.so.7                                                             

0000001  0x00007ffff3c26d07 in STEPConstruct_AP203Context::DefaultPersonAndOrganization() () from /usr/lib/libTKSTEP.so.7                               

0000002  0x00007ffff3c2950e in STEPConstruct_AP203Context::InitPart(STEPConstruct_Part const&) () from 
/usr/lib/libTKSTEP.so.7                          
#3  0x00007ffff3c2e20f in STEPConstruct_ContextTool::GetRootsForPart(STEPConstruct_Part const&) () 
from /usr/lib/libTKSTEP.so.7                    
#4  0x00007ffff3cb62c6 in STEPControl_ActorWrite::Transfer(opencascade::handle<Transfer_Finder> 
const&, opencascade::handle<Transfer_FinderProcess> const&) () from /usr/lib/libTKSTEP.so.7                                                                                                           

#5  0x00007ffff3467d2b in Transfer_ActorOfFinderProcess::Transferring(opencascade::handle<Transfer_Finder> 
const&, opencascade::handle<Transfer_ProcessForFinder> const&) () from /usr/lib/libTKXSBase.so.7                                                                                           

#6  0x00007ffff3470329 in Transfer_ProcessForFinder::TransferProduct(opencascade::handle<Transfer_Finder> 
const&) ()                               
   from /usr/lib/libTKXSBase.so.7                                                                                                                  

0000007  0x00007ffff3473d3c in Transfer_ProcessForFinder::Transferring(opencascade::handle<Transfer_Finder> 
const&) () from /usr/lib/libTKXSBase.so.7   
0000008  0x00007ffff3474167 in Transfer_ProcessForFinder::Transfer(opencascade::handle<Transfer_Finder> 
const&) () from /usr/lib/libTKXSBase.so.7       
0000009  0x00007ffff34e956f in ?? () from /usr/lib/libTKXSBase.so.7                                                                                     

#10 0x00007ffff34e98d8 in XSControl_Controller::TransferWriteShape(TopoDS_Shape const&, opencascade::handle<Transfer_FinderProcess> 
const&, opencascade::handle<Interface_InterfaceModel> const&, int) const () from /usr/lib/libTKXSBase.so.7                                                        

0000011 0x00007ffff3cba9ad in STEPControl_Controller::TransferWriteShape(TopoDS_Shape const&, opencascade::handle<Transfer_FinderProcess> 
const&, opencascade::handle<Interface_InterfaceModel> const&, int) const () from /usr/lib/libTKSTEP.so.7                                                        

#12 0x00007ffff35028b5 in XSControl_TransferWriter::TransferWriteShape(opencascade::handle<Interface_InterfaceModel> 
const&, TopoDS_Shape const&)  
    () from /usr/lib/libTKXSBase.so.7                                                                                                              

0000013 0x00007ffff350b80f in XSControl_WorkSession::TransferWriteShape(TopoDS_Shape const&, bool) () 
from /usr/lib/libTKXSBase.so.7                   
0000014 0x00007ffff3cc1fc2 in STEPControl_Writer::Transfer(TopoDS_Shape const&, STEPControl_StepModelType, 
bool) () from /usr/lib/libTKSTEP.so.7 
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0096757)
git (administrator)
2020-11-13 19:59

Branch CR31925 has been created by kgv.

SHA-1: de0c75694ad9c9523bbe0d6920935d11627bc7d9


Detailed log of new commits:

Author: kgv
Date: Fri Nov 13 19:59:24 2020 +0300

    0031925: Foundation Classes, OSD_Host::InternetAddress() - possible NULL dereference on copying gethostbyname() result
    
    Changes on non-Windows platforms:
    - Deprecated gethostbyname() has been replaced by getifaddrs()+inet_ntop() handling IPv4+IPv6 addresses;
    - External IPs are now preferred comparing to dummy localhost 127.0.0.1.
(0096774)
kgv (developer)
2020-11-14 09:40

Patch is ready for review
- OCCT branch: CR31925.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31925-master-KGV/view/COMPARE/ [^]
(0096810)
abv (manager)
2020-11-17 09:29
edited on: 2020-11-17 09:29

Reviewed, please integrate; note that the patch should be checked for compilation on old Linux platforms

(0096914)
git (administrator)
2020-11-20 12:04

Branch CR31925 has been updated by kgv.

SHA-1: ee1aa503150ef25f872f979c3d9963db42ff2841


Detailed log of new commits:

Author: kgv
Date: Fri Nov 20 12:04:33 2020 +0300

    # fallback for old Android


- Issue History
Date Modified Username Field Change
2020-11-13 16:42 kgv New Issue
2020-11-13 16:42 kgv Assigned To => abv
2020-11-13 19:59 git Note Added: 0096757
2020-11-14 09:40 kgv Note Added: 0096774
2020-11-14 09:40 kgv Status new => resolved
2020-11-15 17:51 kgv Product Version 7.4.0 => 5.2.2
2020-11-17 09:29 abv Note Added: 0096810
2020-11-17 09:29 abv Assigned To abv => bugmaster
2020-11-17 09:29 abv Status resolved => reviewed
2020-11-17 09:29 abv Note Edited: 0096810 View Revisions
2020-11-20 12:04 git Note Added: 0096914
2020-11-20 12:04 kgv Assigned To bugmaster => kgv
2020-11-20 12:04 kgv Status reviewed => assigned


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker