Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write through uninitialized pointer #35

Open
edgar-bonet opened this issue Nov 10, 2019 · 0 comments
Open

Write through uninitialized pointer #35

edgar-bonet opened this issue Nov 10, 2019 · 0 comments

Comments

@edgar-bonet
Copy link
Contributor

In mathmap_cmdline.c, the function cmdline_mathmap_get_pixel() contains something along these lines:

if (cache_entries[frame] == 0)
{
    cache_entry_t *cache_entry;  // uninitialized pointer...

    if (drawable->kind == INPUT_DRAWABLE_CMDLINE_IMAGE)
    {
        // ...conditionally initialized here:
        cache_entry = get_cache_entry_for_image(...);
        ...
    }
#ifdef MOVIES
    else
    {
        ...
    }
#endif

    // ...and unconditionally used here:
    bind_cache_entry_to_drawable(cache_entry, drawable, frame);
}

If the condition of the second if evaluates to false, the function bind_cache_entry_to_drawable() gets an uninitialized pointer. That function, however, expects the pointer to be valid, as it will use it for writing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant