mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-11 17:14:22 +01:00
gossipd: Handle failed lseek(...)
This commit is contained in:
committed by
Christian Decker
parent
e308423954
commit
8cc02f63bc
@@ -130,7 +130,10 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
|
||||
const char *bad;
|
||||
size_t stats[] = {0, 0, 0, 0};
|
||||
|
||||
lseek(gs->fd, known_good, SEEK_SET);
|
||||
if (lseek(gs->fd, known_good, SEEK_SET) < 0) {
|
||||
status_unusual("gossip_store: lseek failure");
|
||||
goto truncate_nomsg;
|
||||
}
|
||||
while (read(gs->fd, &belen, sizeof(belen)) == sizeof(belen)) {
|
||||
msglen = be32_to_cpu(belen);
|
||||
msg = tal_arr(gs, u8, msglen);
|
||||
|
||||
Reference in New Issue
Block a user