levin108/hybrid — Issue #5: 缓冲区溢出
Author: yuyichao
Created: 2011-11-26 12:58:32+00:00
State: open

一运行就出现这么一条错误:
INFO init the blist cache from /home/yuyichao/.config/hybrid/blist.xml
INFO initialize module
INFO fetion is now logining...
INFO connecting to uid.fetion.com.cn:443
INFO
set socket to be nonblock
INFO resolve host 'uid.fetion.com.cn'
INFO ip of 'uid.fetion.com.cn' is '221.130.45.212'[new]
*** buffer overflow detected ***: hybrid terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7f49f3f9dcf7]
/lib/libc.so.6(+0xe7ca0)[0x7f49f3f9bca0]
hybrid(hybrid_proxy_connect+0x13b)[0x40e99b]
hybrid(hybrid_ssl_connect+0x111)[0x40ecd1]
/usr/lib/hybrid/protocols/libfetion.so(+0x605f)[0x7f49e878705f]
hybrid(hybrid_account_enable_all+0x18)[0x411a58]
hybrid(main+0x26c)[0x40df6c]
/lib/libc.so.6(__libc_start_main+0xed)[0x7f49f3ed517d]
hybrid[0x40dfad]
(==Memory map==就不贴了)
然后找了一下, 编译的时候有这么一条警告, 好像错误类型和位置都是一样的.

[ 24%] Building C object CMakeFiles/hybrid.dir/lib/connect.c.o
In file included from /usr/include/string.h:642:0,
from /tmp/yaourt-tmp-yuyichao/aur-hybrid-im-git/src/hybrid/lib/util.h:26,
from /tmp/yaourt-tmp-yuyichao/aur-hybrid-im-git/src/hybrid/lib/connect.c:24:
在函数‘memset’中,
内联自‘addr_init’于 /tmp/yaourt-tmp-yuyichao/aur-hybrid-im-git/src/hybrid/lib/connect.c:81:11,
内联自‘hybrid_proxy_connect’于 /tmp/yaourt-tmp-yuyichao/aur-hybrid-im-git/src/hybrid/lib/connect.c:118:18:
/usr/include/bits/string3.h:85:3: 警告：对 __builtin___memset_chk 的调用总是导致目标缓冲区溢出 [默认启用]