Page MenuHomeFreeBSD

bhyvectl: send_message() returns garbage
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Mar 3 2023, 11:37 AM.
Tags
Referenced Files
Unknown Object (File)
Wed, Dec 25, 9:01 PM
Unknown Object (File)
Sun, Dec 22, 5:58 PM
Unknown Object (File)
Nov 19 2024, 3:02 PM
Unknown Object (File)
Nov 12 2024, 3:53 PM
Unknown Object (File)
Nov 10 2024, 11:14 AM
Unknown Object (File)
Oct 7 2024, 6:15 AM
Unknown Object (File)
Sep 27 2024, 9:14 PM
Unknown Object (File)
Sep 27 2024, 6:34 AM

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 Skipped
Unit
Tests Skipped

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