Page MenuHomeFreeBSD

bhyvectl: send_message() returns garbage
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Mar 3 2023, 11:37 AM.
Tags
Referenced Files
F132425144: D38886.diff
Thu, Oct 16, 8:07 PM
Unknown Object (File)
Mon, Oct 13, 11:00 PM
Unknown Object (File)
Sat, Oct 11, 8:07 PM
Unknown Object (File)
Sat, Oct 11, 8:07 PM
Unknown Object (File)
Sat, Oct 11, 8:06 PM
Unknown Object (File)
Sat, Oct 11, 8:06 PM
Unknown Object (File)
Sat, Oct 11, 11:09 AM
Unknown Object (File)
Mon, Oct 6, 7:32 PM

Details

Summary

Variable 'err' is used uninitialized in some cases and returned
as result of function.

Sponsored by: vStack

Test Plan

Compile bhyvectl, run 'bhyvectl --suspend', verify send_message() returns 0 on success.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/bhyvectl/bhyvectl.c
1693

When connect() fails, this function returns errno, but here it returns -1. Shouldn't it be consistent?

1710

Shouldn't we set err here?

gusev.vitaliy_gmail.com added inline comments.
usr.sbin/bhyvectl/bhyvectl.c
1693

Done.

1710

Done.

This revision is now accepted and ready to land.Mar 3 2023, 2:58 PM