buffer overflow at 1.1.0 amd64

Bug #1155142 reported by NeonXP
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cuneiform for Linux
New
Undecided
Unassigned

Bug Description

$ cuneiform -l ruseng -o result4.txt test4.png

Cuneiform for Linux 1.1.0
*** buffer overflow detected ***: cuneiform terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f221c455807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7f221c454700]
/usr/lib/x86_64-linux-gnu/cuneiform/libfon32.so.0(+0x20a32)[0x7f2216ca0a32]
/usr/lib/x86_64-linux-gnu/cuneiform/libfon32.so.0(+0x20c7a)[0x7f2216ca0c7a]
/usr/lib/x86_64-linux-gnu/cuneiform/libfon32.so.0(FONRecog2Glue+0x1a7)[0x7f2216c901d7]
/usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.0(+0x7251)[0x7f221682d251]
/usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.0(+0x7457)[0x7f221682d457]
/usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.0(+0xa60e)[0x7f221683060e]
/usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.0(+0xa82f)[0x7f221683082f]
/usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.0(p2_proc+0x974)[0x7f22168311e4]
/usr/lib/x86_64-linux-gnu/cuneiform/librstr.so.0(+0x938b3)[0x7f22195908b3]
/usr/lib/x86_64-linux-gnu/cuneiform/librstr.so.0(RSTRRecognizeMain+0x205)[0x7f22195a2e75]
/usr/lib/x86_64-linux-gnu/cuneiform/librstr.so.0(RSTRRecognize+0x19)[0x7f22195a3399]
/usr/lib/x86_64-linux-gnu/libcuneiform.so.0(+0xbee6)[0x7f221ce95ee6]
/usr/lib/x86_64-linux-gnu/libcuneiform.so.0(PUMA_XFinalRecognition+0xd1)[0x7f221ce976f1]
cuneiform[0x4028a6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f221c36c76d]
cuneiform[0x402ba1]
======= Memory map: ========
00400000-00404000 r-xp 00000000 08:01 16400676 /usr/bin/cuneiform
00603000-00604000 r--p 00003000 08:01 16400676 /usr/bin/cuneiform
00604000-00605000 rw-p 00004000 08:01 16400676 /usr/bin/cuneiform
00afb000-014c4000 rw-p 00000000 00:00 0 [heap]
7f220f01c000-7f220f01d000 ---p 00000000 00:00 0
7f220f01d000-7f220f81d000 rw-p 00000000 00:00 0
7f2211b22000-7f2212175000 rw-p 00000000 00:00 0
7f2212175000-7f2212c10000 r--p 00000000 08:01 16390422 /usr/lib/locale/locale-archive
7f2212c10000-7f2212c15000 r-xp 00000000 08:01 16391141 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2212c15000-7f2212e14000 ---p 00005000 08:01 16391141 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2212e14000-7f2212e15000 r--p 00004000 08:01 16391141 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2212e15000-7f2212e16000 rw-p 00005000 08:01 16391141 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2212e16000-7f2212e18000 r-xp 00000000 08:01 16391128 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2212e18000-7f2213017000 ---p 00002000 08:01 16391128 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2213017000-7f2213018000 r--p 00001000 08:01 16391128 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2213018000-7f2213019000 rw-p 00002000 08:01 16391128 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2213019000-7f2213020000 r-xp 00000000 08:01 8388733 /lib/x86_64-linux-gnu/librt-2.15.so
7f2213020000-7f221321f000 ---p 00007000 08:01 8388733 /lib/x86_64-linux-gnu/librt-2.15.so
7f221321f000-7f2213220000 r--p 00006000 08:01 8388733 /lib/x86_64-linux-gnu/librt-2.15.so
7f2213220000-7f2213221000 rw-p 00007000 08:01 8388733 /lib/x86_64-linux-gnu/librt-2.15.so
7f2213221000-7f221323e000 r-xp 00000000 08:01 16385747 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f221323e000-7f221343d000 ---p 0001d000 08:01 16385747 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f221343d000-7f221343e000 r--p 0001c000 08:01 16385747 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f221343e000-7f221343f000 rw-p 0001d000 08:01 16385747 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f221343f000-7f2213446000 r-xp 00000000 08:01 17702407 /usr/lib/x86_64-linux-gnu/cuneiform/libr3532.so.1.1.0
7f2213446000-7f2213645000 ---p 00007000 08:01 17702407 /usr/lib/x86_64-linux-gnu/cuneiform/libr3532.so.1.1.0
7f2213645000-7f2213646000 r--p 00006000 08:01 17702407 /usr/lib/x86_64-linux-gnu/cuneiform/libr3532.so.1.1.0
7f2213646000-7f2213647000 rw-p 00007000 08:01 17702407 /usr/lib/x86_64-linux-gnu/cuneiform/libr3532.so.1.1.0
7f2213647000-7f221364a000 rw-p 00000000 00:00 0
7f221364a000-7f221364b000 r-xp 00000000 08:01 17702300 /usr/lib/x86_64-linux-gnu/cuneiform/libcpu32.so.1.1.0
7f221364b000-7f221384a000 ---p 00001000 08:01 17702300 /usr/lib/x86_64-linux-gnu/cuneiform/libcpu32.so.1.1.0
7f221384a000-7f221384b000 r--p 00000000 08:01 17702300 /usr/lib/x86_64-linux-gnu/cuneiform/libcpu32.so.1.1.0
7f221384b000-7f221384c000 rw-p 00001000 08:01 17702300 /usr/lib/x86_64-linux-gnu/cuneiform/libcpu32.so.1.1.0
7f221384c000-7f221384d000 r-xp 00000000 08:01 17702404 /usr/lib/x86_64-linux-gnu/cuneiform/libmmx32.so.1.1.0
7f221384d000-7f2213a4c000 ---p 00001000 08:01 17702404 /usr/lib/x86_64-linux-gnu/cuneiform/libmmx32.so.1.1.0
7f2213a4c000-7f2213a4d000 r--p 00000000 08:01 17702404 /usr/lib/x86_64-linux-gnu/cuneiform/libmmx32.so.1.1.0
7f2213a4d000-7f2213a4e000 rw-p 00001000 08:01 17702404 /usr/lib/x86_64-linux-gnu/cuneiform/libmmx32.so.1.1.0
7f2213a4e000-7f2213a8e000 rw-p 00000000 00:00 0
7f2213a8e000-7f2213aa1000 r-xp 00000000 08:01 17702417 /usr/lib/x86_64-linux-gnu/cuneiform/librlings.so.1.1.0
7f2213aa1000-7f2213ca0000 ---p 00013000 08:01 17702417 /usr/lib/x86_64-linux-gnu/cuneiform/librlings.so.1.1.0
7f2213ca0000-7f2213ca1000 r--p 00012000 08:01 17702417 /usr/lib/x86_64-linux-gnu/cuneiform/librlings.so.1.1.0
7f2213ca1000-7f2213ca2000 rw-p 00013000 08:01 17702417 /usr/lib/x86_64-linux-gnu/cuneiform/librlings.so.1.1.0
7f2213ca2000-7f2213cbb000 rw-p 00000000 00:00 0
7f2213cbb000-7f2213cd3000 r-xp 00000000 08:01 17702397 /usr/lib/x86_64-linux-gnu/cuneiform/libdif32.so.1.1.0
7f2213cd3000-7f2213ed2000 ---p 00018000 08:01 17702397 /usr/lib/x86_64-linux-gnu/cuneiform/libdif32.so.1.1.0
7f2213ed2000-7f2213ed3000 r--p 00017000 08:01 17702397 /usr/lib/x86_64-linux-gnu/cuneiform/libdif32.so.1.1.0
7f2213ed3000-7f2213ed7000 rw-p 00018000 08:01 17702397 /usr/lib/x86_64-linux-gnu/cuneiform/libdif32.so.1.1.0
7f2213ed7000-7f2213eda000 rw-p 00000000 00:00 0
7f2213eda000-7f2213ee2000 r-xp 00000000 08:01 16391542 /usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0
7f2213ee2000-7f22140e2000 ---p 00008000 08:01 16391542 /usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0
7f22140e2000-7f22140e3000 r--p 00008000 08:01 16391542 /usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0
7f22140e3000-7f22140e4000 rw-p 00009000 08:01 16391542 /usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0
7f22140e4000-7f22140f1000 r-xp 00000000 08:01 16391419 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7f22140f1000-7f22142f0000 ---p 0000d000 08:01 16391419 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7f22142f0000-7f22142f1000 r--p 0000c000 08:01 16391419 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7f22142f1000-7f22142f2000 rw-p 0000d000 08:01 16391419 /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
7f22142f2000-7f2214308000 r-xp 00000000 08:01 8392287 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2214308000-7f2214507000 ---p 00016000 08:01 8392287 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2214507000-7f2214508000 r--p 00015000 08:01 8392287 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2214508000-7f2214509000 rw-p 00016000 08:01 8392287 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f2214509000-7f221465a000 r-xp 00000000 08:01 16384126 /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f221465a000-7f2214859000 ---p 00151000 08:01 16384126 /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f2214859000-7f2214861000 r--p 00150000 08:01 16384126 /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f2214861000-7f2214863000 rw-p 00158000 08:01 16384126 /usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8
7f2214863000-7f2214864000 rw-p 00000000 00:00 0
7f2214864000-7f2214873000 r-xp 00000000 08:01 8392175 /lib/x86_64-linux-gnu/libbz2.so.1.0.4
7f2214873000-7f2214a72000 ---p 0000f000 08:01 8392175 /lib/x86_64-linux-gnu/libbz2.so.1.0.4
7f2214a72000-7f2214a73000 r--p 0000e000 08:01 8392175 /lib/x86_64-linux-gnu/libbz2.so.1.0.4
7f2214a73000-7f2214a74000 rw-p 0000f000 08:01 8392175 /lib/x86_64-linux-gnu/libbz2.so.1.0.4
7f2214a74000-7f2214ba3000 r-xp 00000000 08:01 16391124 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2214ba3000-7f2214da3000 ---p 0012f000 08:01 16391124 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2214da3000-7f2214da4000 r--p 0012f000 08:01 16391124 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2214da4000-7f2214da8000 rw-p 00130000 08:01 16391124 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2214da8000-7f2214db8000 r-xp 00000000 08:01 16391143 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2214db8000-7f2214fb7000 ---p 00010000 08:01 16391143 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2214fb7000-7f2214fb8000 r--p 0000f000 08:01 16391143 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2214fb8000-7f2214fb9000 rw-p 00010000 08:01 16391143 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2214fb9000-7f2214fd4000 r-xp 00000000 08:01 16391783 /usr/lib/x86_64-linux-gnu/libwmflite-0.2.so.7.0.1
7f2214fd4000-7f22151d3000 ---p 0001b000 08:01 16391783 /usr/lib/x86_64-linux-gnu/libwmflite-0.2.so.7.0.1
7f22151d3000-7f22151d4000 r--p 0001a000 08:01 16391783 /usr/lib/x86_64-linux-gnu/libwmflite-0.2.so.7.0.1
7f22151d4000-7f22151d5000 rw-p 0001b000 08:01 16391783 /usr/lib/x86_64-linux-gnu/libwmflite-0.2.so.7.0.1
7f22151d5000-7f22151fb000 r-xp 00000000 08:01 8392253 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f22151fb000-7f22153fb000 ---p 00026000 08:01 8392253 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f22153fb000-7f22153fc000 r--p 00026000 08:01 8392253 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f22153fc000-7f22153fd000 rw-p 00027000 08:01 8392253 /lib/x86_64-linux-gnu/libpng12.so.0.46.0
7f22153fd000-7f221543b000 r-xp 00000000 08:01 16386889 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f221543b000-7f221563b000 ---p 0003e000 08:01 16386889 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f221563b000-7f221563c000 r--p 0003e000 08:01 16386889 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f221563c000-7f221563d000 rw-p 0003f000 08:01 16386889 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f221563d000-7f221564d000 rw-p 00000000 00:00 0
7f221564d000-7f2215699000 r-xp 00000000 08:01 16391513 /usr/lib/x86_64-linux-gnu/libjasper.so.1.0.0
7f2215699000-7f2215898000 ---p 0004c000 08:01 16391513 /usr/lib/x86_64-linux-gnu/libjasper.so.1.0.0
7f2215898000-7f2215899000 r--p 0004b000 08:01 16391513 /usr/lib/x86_64-linux-gnu/libjasper.so.1.0.0
7f2215899000-7f221589d000 rw-p 0004c000 08:01 16391513 /usr/lib/x86_64-linux-gnu/libjasper.so.1.0.0
7f221589d000-7f22158a4000 rw-p 00000000 00:00 0
7f22158a4000-7f221593a000 r-xp 00000000 08:01 16384247 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f221593a000-7f2215b39000 ---p 00096000 08:01 16384247 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f2215b39000-7f2215b3f000 r--p 00095000 08:01 16384247 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f2215b3f000-7f2215b40000 rw-p 0009b000 08:01 16384247 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.8.0
7f2215b40000-7f2215ba1000 r-xp 00000000 08:01 16384650 /usr/lib/x86_64-linux-gnu/libtiff.so.4.3.4
7f2215ba1000-7f2215da0000 ---p 00061000 08:01 16384650 /usr/lib/x86_64-linux-gnu/libtiff.so.4.3.4
7f2215da0000-7f2215da2000 r--p 00060000 08:01 16384650 /usr/lib/x86_64-linux-gnu/libtiff.so.4.3.4
7f2215da2000-7f2215da3000 rw-p 00062000 08:01 16384650 /usr/lib/x86_64-linux-gnu/libtiff.so.4.3.4
7f2215da3000-7f2215dd6000 r-xp 00000000 08:01 16391531 /usr/lib/x86_64-linux-gnu/liblcms.so.1.0.19
7f2215dd6000-7f2215fd6000 ---p 00033000 08:01 16391531 /usr/lib/x86_64-linux-gnu/liblcms.so.1.0.19
7f2215fd6000-7f2215fd7000 r--p 00033000 08:01 16391531 /usr/lib/x86_64-linux-gnu/liblcms.so.1.0.19
7f2215fd7000-7f2215fd8000 rw-p 00034000 08:01 16391531 /usr/lib/x86_64-linux-gnu/liblcms.so.1.0.19
7f2215fd8000-7f2215fda000 rw-p 00000000 00:00 0
7f2215fda000-7f2215fdc000 r-xp 00000000 08:01 8388728 /lib/x86_64-linux-gnu/libdl-2.15.so
7f2215fdc000-7f22161dc000 ---p 00002000 08:01 8388728 /lib/x86_64-linux-gnu/libdl-2.15.so
7f22161dc000-7f22161dd000 r--p 00002000 08:01 8388728 /lib/x86_64-linux-gnu/libdl-2.15.so
7f22161dd000-7f22161de000 rw-p 00003000 08:01 8388728 /lib/x86_64-linux-gnu/libdl-2.15.so
7f22161de000-7f22161f7000 r-xp 00000000 08:01 17702401 /usr/lib/x86_64-linux-gnu/cuneiform/libleo32.so.1.1.0
7f22161f7000-7f22163f6000 ---p 00019000 08:01 17702401 /usr/lib/x86_64-linux-gnu/cuneiform/libleo32.so.1.1.0
7f22163f6000-7f22163f7000 r--p 00018000 08:01 17702401 /usr/lib/x86_64-linux-gnu/cuneiform/libleo32.so.1.1.0
7f22163f7000-7f22163f8000 rw-p 00019000 08:01 17702401 /usr/lib/x86_64-linux-gnu/cuneiform/libleo32.so.1.1.0
7f22163f8000-7f22163fd000 rw-p 00000000 00:00 0
7f22163fd000-7f2216404000 r-xp 00000000 08:01 17702424 /usr/lib/x86_64-linux-gnu/cuneiform/librsadd.so.1.1.0
7f2216404000-7f2216603000 ---p 00007000 08:01 17702424 /usr/lib/x86_64-linux-gnu/cuneiform/librsadd.so.1.1.0
7f2216603000-7f2216604000 r--p 00006000 08:01 17702424 /usr/lib/x86_64-linux-gnu/cuneiform/librsadd.so.1.1.0
7f2216604000-7f2216605000 rw-p 00007000 08:01 17702424 /usr/lib/x86_64-linux-gnu/cuneiform/librsadd.so.1.1.0
7f2216605000-7f2216622000 r-xp 00000000 08:01 17702408 /usr/lib/x86_64-linux-gnu/cuneiform/librbal.so.1.1.0
7f2216622000-7f2216822000 ---p 0001d000 08:01 17702408 /usr/lib/x86_64-linux-gnu/cuneiform/librbal.so.1.1.0
7f2216822000-7f2216823000 r--p 0001d000 08:01 17702408 /usr/lib/x86_64-linux-gnu/cuneiform/librbal.so.1.1.0
7f2216823000-7f2216824000 rw-p 0001e000 08:01 17702408 /usr/lib/x86_64-linux-gnu/cuneiform/librbal.so.1.1.0
7f2216824000-7f2216826000 rw-p 00000000 00:00 0
7f2216826000-7f2216835000 r-xp 00000000 08:01 17702406 /usr/lib/x86_64-linux-gnu/cuneiform/libpass2.so.1.1.0[1] + 29442 exit 6 cuneiform -l ruseng -o result4.txt test4.png

Revision history for this message
NeonXP (neonxp) wrote :
Revision history for this message
mpw (matthiaspeterw) wrote :

This bug appears for me at about each 10th page and makes cuneiform unusuable. Any intensions to finally fix it? It's from 2011.

Revision history for this message
kosot (kosott) wrote :

Small workaround:

        cuneiform -l ruseng $file.gif
        if [ ! -f cuneiform-out.txt ]; then
                echo OCR Fail trying Blur
                convert -adaptive-blur 2 $file.gif $file-blur.gif
                cuneiform -l ruseng $file-blur.gif
        fi
        if [ ! -f cuneiform-out.txt ]; then
                echo OCR Fail trying resize 200%
                convert -resize 200% $file.gif $file-200.gif
                cuneiform -l ruseng $file-200.gif
        fi

it works on your smple file.

Revision history for this message
Ethoz (ethoz) wrote :

Note above helped me with TIFF files. Also, in some cases, help another version of the ImageMagick library

LD_PRELOAD=/path/to/another/imagemagick/lib/libMagick++-6.Q16.so cuneiform file.tiff

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.