Skip to content

[Coverity 1666223] Logically dead code in mmsh.c

The indicated dead code may have performed some action; that action will never occur.

In OpenConnection: Code can never be reached because of a logical contradiction (CWE-561)

530    vlc_tls_t *sock = vlc_tls_SocketOpenTCP( VLC_OBJECT(p_access),
531                                             srv->psz_host, srv->i_port );
      cond_notnull: Condition sock == NULL, taking false branch. Now the value of sock is not NULL.
532    if( sock == NULL )
533    {
534        free( stream->ptr );
535        return VLC_EGENERIC;
536    }
537
538    msg_Dbg( p_access, "sending request:\n%s", stream->ptr );
539
540    ssize_t val = vlc_tls_Write( sock, stream->ptr, stream->length );
541    free( stream->ptr );
542    if( val < (ssize_t)stream->length )
543    {
544        msg_Err( p_access, "failed to send request" );
545        vlc_tls_Close( sock );
546        stream = NULL;
547    }
548
549    p_sys->stream = sock;
      notnull: At condition sock != NULL, the value of sock cannot be NULL.
      dead_error_condition: The condition sock != NULL must be true.
     
CID 1666223: (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression -2147483648 inside this statement: return (sock != NULL) ? 0 :....
550    return (sock != NULL) ? VLC_SUCCESS : VLC_EGENERIC;
551}

In line 546 sock should be likely have been set to NULL based in 016e42bc

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information