这个是bug吗?get_host_name() core dump on AIX
AIX中,如果在/etc/hosts中一个IP定义多个hostname,调get_host_name就会core dump. 是bug吗?/etc/hosts:
10.0.1.10 aixu01aa01
code:
ACE_INET_Addr remoteAddr;
remoteAddr.set((int)7011, "10.0.1.10");
cout<<remoteAddr.get_host_name()<<endl; // get "Illegal instruction (core dumped)" here
注:如果hosts里10.0.1.10只定义一个hostname,运行正常。 interesting, get_host_name( is using static buffer. It could be a buffer overflow bug.
Can you try get_host_name(largebuf, largesize) instead?
页:
[1]