Skip to content

Check realloc return value#9722

Open
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:path_realloc
Open

Check realloc return value#9722
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:path_realloc

Conversation

@radarhere

Copy link
Copy Markdown
Member

Pillow/src/path.c

Lines 340 to 342 in 6a8de89

/* shrink coordinate array */
/* malloc check ok, self->count is smaller than it was before */
self->xy = realloc(self->xy, 2 * self->count * sizeof(double));

The comment comes from 4b4ef5f. It is saying that since we a reallocating to a smaller size, the realloc operation should not fail.

However, perhaps we can satisfy code vulnerability scanners by checking it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant