Skip to content

stage: fix null pointer arithmetic in stage_insert_chunk()#1417

Open
PatriciaBucataru wants to merge 1 commit intojonas:masterfrom
PatriciaBucataru:fix/null-ptr-arithmetic-stage-insert-chunk
Open

stage: fix null pointer arithmetic in stage_insert_chunk()#1417
PatriciaBucataru wants to merge 1 commit intojonas:masterfrom
PatriciaBucataru:fix/null-ptr-arithmetic-stage-insert-chunk

Conversation

@PatriciaBucataru
Copy link
Copy Markdown

to and last_unchanged_line were used in pointer arithmetic before the null check on to at line 338. If to is NULL, computing to - view->line is undefined behaviour per C11 6.5.6.

Moved the pointer arithmetic after the null check.

to and last_unchanged_line were used in pointer arithmetic before
the null check on to at line 338. If to is NULL, computing to - view->line
is undefined behaviour per C11 6.5.6.

Moved the pointer arithmetic after the null check.
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

Successfully merging this pull request may close these issues.

1 participant