• Andrei Vagin's avatar
    criu: fix gcc-8 warnings · 41305072
    Andrei Vagin authored
    criu/sk-packet.c:443:3: error: 'strncpy' output may be truncated
    copying 14 bytes from a string of length 15
       strncpy(addr_spkt.sa_data, req.ifr_name, sa_data_size);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/img-remote.c:383:3: error: 'strncpy' specified bound 4096
    equals destination size
       strncpy(snapshot_id, li->snapshot_id, PATHLEN);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/img-remote.c:384:3: error: 'strncpy' specified bound 4096
    equals destination size
       strncpy(path, li->name, PATHLEN);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/files.c:288:3: error: 'strncpy' output may be truncated copying
    4095 bytes from a string of length 4096
       strncpy(buf, link->name, PATH_MAX - 1);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/sk-unix.c:239:36: error: '/' directive output may be truncated
    writing 1 byte into a region of size between 0 and 4095
       snprintf(path, sizeof(path), ".%s/%s", dir, sk->name);
                                        ^
    criu/sk-unix.c:239:3: note: 'snprintf' output 3 or more bytes
    (assuming 4098) into a destination of size 4096
       snprintf(path, sizeof(path), ".%s/%s", dir, sk->name);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/mount.c:2563:3: error: 'strncpy' specified bound 4096 equals
    destination size
       strncpy(path, m->mountpoint, PATH_MAX);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu/cr-restore.c:3647:2: error: 'strncpy' specified bound 16 equals
    destination size
      strncpy(task_args->comm, core->tc->comm, sizeof(task_args->comm));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    41305072
Name
Last commit
Last update
..
c Loading commit data...
py Loading commit data...
Makefile Loading commit data...