Skip to content
  • Xie Yongji's avatar
    d9cf16c0
    libvduse: Replace strcpy() with strncpy() · d9cf16c0
    Xie Yongji authored
    
    
    Coverity reported a string overflow issue since we copied
    "name" to "dev_config->name" without checking the length.
    This should be a false positive since we already checked
    the length of "name" in vduse_name_is_invalid(). But anyway,
    let's replace strcpy() with strncpy() (as a general library,
    we'd like to minimize dependencies on other libraries, so we
    didn't use g_strlcpy() here) to fix the coverity complaint.
    
    Fixes: Coverity CID 1490224
    Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20220706095624.328-3-xieyongji@bytedance.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    d9cf16c0
    libvduse: Replace strcpy() with strncpy()
    Xie Yongji authored
    
    
    Coverity reported a string overflow issue since we copied
    "name" to "dev_config->name" without checking the length.
    This should be a false positive since we already checked
    the length of "name" in vduse_name_is_invalid(). But anyway,
    let's replace strcpy() with strncpy() (as a general library,
    we'd like to minimize dependencies on other libraries, so we
    didn't use g_strlcpy() here) to fix the coverity complaint.
    
    Fixes: Coverity CID 1490224
    Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20220706095624.328-3-xieyongji@bytedance.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading