Skip to content

heap overflow in sanitize_rfc1035 #5

@rsmarples

Description

@rsmarples
make test
/Library/Developer/CommandLineTools/usr/bin/make -C test test
cc -g -Wall -Wextra -Wundef -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -Winline -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wformat=2 -Wpointer-sign -Wmissing-noreturn -Wredundant-decls -Wconversion -Wstrict-overflow -fsanitize=address,undefined -fno-omit-frame-pointer -std=c11 -DASAN -I.. -I../src -I ../vendor -c ../src/common.c -o ../src/common.o
cc -fsanitize=address,undefined -rdynamic -o hostname hostname.o ../src/common.o 
./hostname
TESTING WE CAN SANITIZE HOSTNAMES FOR RFC1035
valid.hostname: valid.hostname
invalid hostname: invalid-hostname
=================================================================
==41056==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000001c8f at pc 0x000102b80780 bp 0x00016d281700 sp 0x00016d2816f8
READ of size 1 at 0x603000001c8f thread T0
    #0 0x000102b8077c in sanitize_rfc1035 common.c:305
    #1 0x000102b7d748 in test hostname.c:17
    #2 0x000102b7ca18 in main hostname.c:36
    #3 0x00018b11bda0 in start+0x1b4c (dyld:arm64e+0x1fda0)

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