# gdb ./dyn_table_gen core.26896
GNU gdb (GDB) Fedora (7.5.1-32.fc18)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /builddir/build/BUILD/skf-1.99.0/skf-1.99/dyn_table_gen...done.
[New LWP 26896]
Core was generated by `./dyn_table_gen'.
Program terminated with signal 11, Segmentation fault.
#0 0x0804a5d7 in big5a_table_gen () at dyn_table.c:45144
45144 big5a_uni_byte[BIG5P_TBL_LEN+j-950] = big5uao_fa_uni_byte[j];
Missing separate debuginfos, use: debuginfo-install glibc-2.17-1.fc19.i686
(gdb) bt
#0 0x0804a5d7 in big5a_table_gen () at dyn_table.c:45144
#1 0x08048a4e in main (argc=1, argv=0xbff32234) at dyn_table.c:45963
(gdb) li
45139 };
45140 for (j=0;j<BIG5_OFFSET;j++) { /* 8140 - */
45141 big5a_uni_byte[j] = big5uao_81_uni_byte[j];
45142 };
45143 for (j=0;j<HKSCS_FA_LEN;j++) { /* fa00 - */
45144 big5a_uni_byte[BIG5P_TBL_LEN+j-950] = big5uao_fa_uni_byte[j];
45145 };
45146 for (j=0;j<HKSCS_C6_LEN;j++) { /* c640 - */
45147 big5a_uni_byte[11780+j+1330] = big5uao_c6_uni_byte[j];
45148 };
gccの開発者から(開発中の)gcc 4.8でskf 1.99.0のビルドが出来ないと連絡がありました。
http://lists.fedoraproject.org/pipermail/devel/2013-January/175876.html
試してみると、確かにmakeするとdyn_table_genがsegfaultで死んで build出来ません。
gdbで何が起こっているのか調べてみると となっています。そこでBIG5P_TBL_LENとかがどうなっているかを見てみますと となっていて、確かにbuffer overflowが起こっています。
big5a_uni_byteの正しいサイズが分からないため、どう修正したらよいか 分かりません。対応お願いいたします。