Fix SyntheticClient::chunk_file(): check return value of
describe_layout() and handle the error.
CID 966615 Unchecked return value (CWE-252)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
int SyntheticClient::chunk_file(string &filename)
{
int fd = client->open(filename.c_str(), O_RDONLY);
+ int ret;
struct stat st;
client->fstat(fd, &st);
inode_t inode;
memset(&inode, 0, sizeof(inode));
inode.ino = st.st_ino;
- client->describe_layout(fd, &inode.layout);
+ ret = client->describe_layout(fd, &inode.layout);
+ if (ret < 0)
+ return ret;
uint64_t pos = 0;
bufferlist from_before;