• Kir Kolyshkin's avatar
    Use strlcpy · e5654e58
    Kir Kolyshkin authored
    It's better to
    
    1. Use strlcpy() instead of strncpy() as otherwise we might end up
       with a not NULL-terminated string, which opens a portal to hell.
       There are a few places reported by Coverity for this, such as:
        - in criu_connect(), Coverity CID 51591;
        - in proc_pid_parse(), Coverity CID 51590;
        - in move_veth_to_bridge(), Coverity CID 51593;
        - etc.
    
    2. Use strlcpy() instead of strcpy() to avoid buffer overruns.
       Some of these are also reported by Coverity, for example
       the one in dump_filemap(), Coverity CID 51630.
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    e5654e58
criu.c 21.6 KB