Skip to content

tool_operate.c:996:9: runtime error: -1e+21 is outside the range of representable values of type 'long' #1730

@geeknik

Description

@geeknik

I did this

Compiled with UBSan, ASan and afl-clang-fast.

UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ~/curl/src/curl -K test023

I did not expect the following

Warning: test023:4: warning: 'MR' is unknown
Warning: test023:6: warning: '-▒' had unsupported trailing garbage
Warning: test023:9: warning: 'R' is ambiguous
Warning: test023:12: warning: '-m' expected a positive numerical parameter
tool_operate.c:996:9: runtime error: -1e+21 is outside the range of representable values of type 'long'
    #0 0x53fcdf in operate_do /root/curl/src/tool_operate.c:996:9
    #1 0x5305cc in operate /root/curl/src/tool_operate.c:2064:20
    #2 0x52d4f9 in main /root/curl/src/tool_main.c:252:14
    #3 0x7fec17be3b44 in __libc_start_main /build/glibc-6V9RKT/glibc-2.19/csu/libc-start.c:287
    #4 0x42123b in _start (/root/curl/src/curl+0x42123b)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior tool_operate.c:996:9

curl/libcurl version

git 7093488

operating system

Fedora 26 x64

test023.gz

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