open-vm-tools icon indicating copy to clipboard operation
open-vm-tools copied to clipboard

Add error handling in MsgLoadCatalog

Open vangyzen opened this issue 2 years ago • 4 comments

g_io_channel_read_line returns an error status in addition to setting its GError output parameter. Check both for errors.

vangyzen avatar Jul 27 '23 21:07 vangyzen

@vangyzen, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot avatar Jul 27 '23 21:07 vmwclabot

@vangyzen, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot avatar Jul 27 '23 21:07 vmwclabot

@vangyzen, VMware has approved your signed contributor license agreement.

vmwclabot avatar Jul 28 '23 07:07 vmwclabot

This fixes a SIGSEGV on line 518. The line, len, and term variables were clearly uninitialized; they looked like stack addresses. Reading the code for g_io_channel_read_line clearly shows that it can return an error status without touching its output parameters. Unfortunately, I don't know the state of the file system at the time of the crash, so I can't reproduce this.

vangyzen avatar Jul 31 '23 20:07 vangyzen