• E
    rpc: avoid freeing uninitialized variable · 0a8a79af
    Eric Blake 提交于
    Detected by Coverity.  Both are instances of bad things happening
    if pipe2 fails; the virNetClientNew failure could free garbage,
    and virNetSocketNewConnectCommand could close random fds.
    
    Note: POSIX doesn't guarantee the contents of fd[0] and fd[1]
    after pipe failure: http://austingroupbugs.net/view.php?id=467
    We may need to introduce a virPipe2 wrapper that guarantees
    that on pipe failure, the fds are explicitly set to -1, rather
    than our current state of assuming the fds are unchanged from
    their value prior to the failed pipe call.
    
    * src/rpc/virnetclient.c (virNetClientNew): Initialize variable.
    * src/rpc/virnetsocket.c (virNetSocketNewConnectCommand):
    Likewise.
    0a8a79af
virnetclient.c 33.4 KB