Diff between fa1ad60fc754fd970a27dafe7121036de7da74a7 and 8e5a2f9d98307d615fc815daace91479803285c7
Changed Files
| File | Additions | Deletions | Status |
| mesh/keyring.c | +3 | -1 | modified |
Full Patch
diff --git a/mesh/keyring.c b/mesh/keyring.c
index 9fa7d6b..41cb2e9 100644
--- a/mesh/keyring.c
+++ b/mesh/keyring.c
@@ -140,7 +140,9 @@ static void finalize(const char *fpath, uint16_t net_idx)
l_debug("Finalize %s", fpath);
memcpy(key.old_key, key.new_key, 16);
lseek(fd, 0, SEEK_SET);
- write(fd, &key, sizeof(key));
+
+ if (write(fd, &key, sizeof(key)) != sizeof(key))
+ goto done;
done:
close(fd);