Skip to content

Missing return value in parse_cookies() #8

@mgrossmann

Description

@mgrossmann

Summary

parse_cookies() is declared as returning int but has no return statement. This is undefined behavior per C89.

Affected Files

  • src/httpshen.c:46

Details

static int parse_cookies(HTTPC *httpc, const UCHAR *in) {
    /* ... processing ... */
    free(buf);
    /* no return statement */
}

The caller receives whatever value happens to be in the return register.

Fix

Add return 0; at the end (or appropriate error handling).

Severity

HIGH — undefined behavior, compiler may generate unexpected code.

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