Skip to content
  • Peter Maydell's avatar
    59292384
    net: Zero sockaddr_in in parse_host_port() · 59292384
    Peter Maydell authored
    
    
    We don't currently zero-initialize the 'struct sockaddr_in' that
    parse_host_port() fills in, so any fields we don't explicitly
    initialize might be left as random garbage.  POSIX states that
    implementations may define extensions in sockaddr_in, and that those
    extensions must not trigger if zero-initialized.  So not zero
    initializing might result in inadvertently triggering an impdef
    extension.
    
    memset() the sockaddr_in before we start to fill it in.
    
    Fixes: Coverity CID 1005338
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-id: 20210813150506.7768-2-peter.maydell@linaro.org
    59292384
    net: Zero sockaddr_in in parse_host_port()
    Peter Maydell authored
    
    
    We don't currently zero-initialize the 'struct sockaddr_in' that
    parse_host_port() fills in, so any fields we don't explicitly
    initialize might be left as random garbage.  POSIX states that
    implementations may define extensions in sockaddr_in, and that those
    extensions must not trigger if zero-initialized.  So not zero
    initializing might result in inadvertently triggering an impdef
    extension.
    
    memset() the sockaddr_in before we start to fill it in.
    
    Fixes: Coverity CID 1005338
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-id: 20210813150506.7768-2-peter.maydell@linaro.org
Loading