Skip to content

Assertion failed in pm_newline_list_append #3753

@stevenjohnstone

Description

@stevenjohnstone

On 1da0733,

#include <prism.h>

/*
00000000: 250a 237b 3c3c 307d 0a00                 %.#{<<0}..
*/

uint8_t input[] = {
  0x25, 0x0a, 0x23, 0x7b, 0x3c, 0x3c, 0x30, 0x7d, 0x0a, 0x00
};

int main(int argc, const char **argv) {
    (void) argc;
    (void) argv;
    pm_parse_success_p(input, sizeof(input), NULL);
    return 0;
}

built with

$ clang -Iinclude $(find src -name "*.c") -ggdb3 testcase.c -fsanitize=address -o testcase

gives

$ ./testcase
testcase: src/util/pm_newline_list.c:51: _Bool pm_newline_list_append(pm_newline_list_t *, const uint8_t *): Assertion `list->size == 0 || newline_offset > list->offsets[list->size - 1]' failed.
Aborted

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions