• R
    bhyve: fix crash in bhyveBuildNetArgStr · 381a3dbd
    Roman Bogorodskiy 提交于
    bhyveBuildNetArgStr() calls virNetDevTapCreateInBridgePort() and
    passes tapfd = NULL, but tapfdSize = 1. That is wrong, because
    if virNetDevTapCreateInBridgePort() crashes after successfully
    creating a TAP device, it'll jump to 'error' label, that
    loops over tapfd and calls VIR_FORCE_CLOSE:
    
       for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++)
    
    In that case we get a segfault.
    
    As the bhyve code doesn't use tapfd, pass NULL and set tapfdSize to 0.
    381a3dbd
bhyve_command.c 9.2 KB