mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 01:06:58 +00:00
sk: handle erorors of lseek
CID 159475 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) 1. check_return: Calling lseek(img_raw_fd(img), pkt->entry->length, 1) without checking return value. This library function may fail and return an error code. Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
40b68eb405
commit
72b48d2713
1 changed files with 4 additions and 1 deletions
|
|
@ -44,7 +44,10 @@ static int collect_one_packet(void *obj, ProtobufCMessage *msg, struct cr_img *i
|
|||
* will be broken.
|
||||
*/
|
||||
list_add_tail(&pkt->list, &packets_list);
|
||||
lseek(img_raw_fd(img), pkt->entry->length, SEEK_CUR);
|
||||
if (lseek(img_raw_fd(img), pkt->entry->length, SEEK_CUR) < 0) {
|
||||
pr_perror("Unable to change an image offset");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue