mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-16 00:15:01 +00:00
coverity: #438136
String not null terminated Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
8da51ee9b3
commit
aeba3f8005
@ -211,6 +211,7 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
|
||||
char *lxcname = NULL;
|
||||
int fd;
|
||||
int ret;
|
||||
ssize_t bytes;
|
||||
|
||||
/* Destroy clones. */
|
||||
ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name);
|
||||
@ -233,9 +234,9 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = lxc_read_nointr(fd, buf, fbuf.st_size);
|
||||
bytes = lxc_read_nointr(fd, buf, fbuf.st_size);
|
||||
close(fd);
|
||||
if (ret < 0) {
|
||||
if (bytes != (ssize_t)fbuf.st_size) {
|
||||
ERROR("Could not read %s", path);
|
||||
free(buf);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user