Skip to content

[BUG] Divide by zero in img2txt #65

Open
@kdsjZh

Description

@kdsjZh

version: latest commit f42aa68
driver: src/img2txt
Environment: ubuntu 22.04, clang-12
step to reproduce:

export CFLAGS="-fsanitize=address -g"
export CC=clang
./bootstrap
./configure 
make -j8
./src/img2txt ./divide_by_0.seed

Sanitizer output:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==25214==ERROR: AddressSanitizer: FPE on unknown address 0x0000004d0433 (pc 0x0000004d0433 bp 0x7fff1cb39010 sp 0x7fff1cb38ee0 T0)
    #0 0x4d0433 in main /benchmarks/libcaca/src/img2txt.c:183:42
    #1 0x7fa2270f9d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x2dd8f)
    #2 0x7fa2270f9e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2de3f)
    #3 0x421944 in _start (/benchmarks/libcaca/src/img2txt+0x421944)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /benchmarks/libcaca/src/img2txt.c:183:42 in main
==25214==ABORTING

#POC
divide_by_0.zip

##Credit
Han Zheng
NCNIPC of China
Hexhive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions