Skip to content

Avoiding null pointer dereference#1096

Merged
koutcher merged 2 commits intojonas:masterfrom
klebertarcisio:patch-1
Jan 4, 2022
Merged

Avoiding null pointer dereference#1096
koutcher merged 2 commits intojonas:masterfrom
klebertarcisio:patch-1

Conversation

@klebertarcisio
Copy link
Copy Markdown
Contributor

This pull request aims to fix null pointer dereference.

Null pointer dereference

koutcher pushed a commit to koutcher/tig that referenced this pull request Sep 25, 2021
[tk: fixed C90 compliance and tweaked error messages]
@koutcher
Copy link
Copy Markdown
Collaborator

@jonas, I started to review this PR from @binho1991 and have some suggestions, see koutcher@gh-1096-null-pointer-deref.

@krobelus
Copy link
Copy Markdown
Contributor

there are many other places where allocation can fail. Shouldn't we just use xmalloc/xcalloc like git does?

@klebertarcisio
Copy link
Copy Markdown
Contributor Author

Hi @koutcher and @krobelus! Does anything still need to be done for the pull request to be accepted? Some points do not use xmalloc/xcalloc. Is there any difference in their use? If need be, I can change the pull request to use xmalloc and xcalloc. Thanks!

koutcher pushed a commit to koutcher/tig that referenced this pull request Dec 11, 2021
[tk: fixed C90 compliance and tweaked error messages]
koutcher pushed a commit to koutcher/tig that referenced this pull request Dec 11, 2021
[tk: fixed C90 compliance and tweaked error messages]
koutcher pushed a commit to koutcher/tig that referenced this pull request Dec 12, 2021
[tk: fixed C90 compliance and tweaked error messages]
@koutcher
Copy link
Copy Markdown
Collaborator

@binho1991, thank you, I don't think xmalloc/xcalloc would bring any benefit. You did a pretty good job at identifying the missing checks, only a few remained in argv_append. I completed my review in koutcher@4958efe (see src/argv.c and src/util.c), I believe it should be enough.

@klebertarcisio
Copy link
Copy Markdown
Contributor Author

@koutcher thanks for the feedback.

[tk: fixed C90 compliance and tweaked error messages]
@koutcher koutcher merged commit 62eaaf8 into jonas:master Jan 4, 2022
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
[tk: fixed C90 compliance and tweaked error messages]
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.

3 participants