找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 4062|回复: 1

这个是bug吗?get_host_name() core dump on AIX

[复制链接]
发表于 2011-7-30 04:15:43 | 显示全部楼层 |阅读模式
AIX中,如果在/etc/hosts中一个IP定义多个hostname,调get_host_name就会core dump. 是bug吗?

/etc/hosts:
10.0.1.10     aixu01  aa01

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,运行正常。
发表于 2011-8-29 23:50:48 | 显示全部楼层
interesting, get_host_name( is using static buffer. It could be a buffer overflow bug.
Can you try get_host_name(largebuf, largesize) instead?
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-14 10:52 , Processed in 0.011662 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表