levin108 / hybrid

Hybird is a lightweight IM framework, currently supports China Mobile Fetion protocol and xmpp protocol.
levin108.github.com/hybrid
GNU General Public License v2.0
110 stars 27 forks source link

缓冲区溢出 #5

Closed yuyichao closed 12 years ago

yuyichao commented 12 years ago

一运行就出现这么一条错误: 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

[ 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 的调用总是导致目标缓冲区溢出 [默认启用]

yuyichao commented 12 years ago

应该是connect.c:81memset多了一个&

yuyichao commented 12 years ago

这个错终于体现出来是因为改了编译选项么? 还是因为memset多了一个检查?

levin108 commented 12 years ago

编译选项我到没改,有可能是编译器的版本的问题,我这边到也没提示这个warning

yuyichao commented 12 years ago

我的gcc -v $ gcc -v 使用内建 specs。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper 目标:x86_64-unknown-linux-gnu 配置为:/build/src/gcc-4.6.2/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --enable-multilib --disable-libssp --disable-libstdcxx-pch --enable-checking=release 线程模型:posix gcc 版本 4.6.2 (GCC)