Skip to content

Should object_make_string check for NULL input string? #10

@ghost

Description

Currently, I get a crash at

ape/ape.c

Lines 10208 to 10209 in d4a0c5c

object_t object_make_string(gcmem_t *mem, const char *string) {
int len = (int)strlen(string);
because I sometimes may pass NULL to the string parameter, and strlen crashes on NULL input on Ubuntu 16.04, should this part of code maybe do a check

object_t object_make_string(gcmem_t *mem, const char *string) {
    if (string == NULL) {
        return object_make_null();
    }
    int len = (int)strlen(string);

to handle non-expected NULL gracefully without crashing? :)

Thanks! Ape is great, I'm having a blast with it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions