diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2017-02-07 11:26:10 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2017-02-07 14:12:22 +0100 |
commit | d927f252d5a9181b27b3061f83d6fdf53fa64bdc (patch) | |
tree | 1397acf121dc21d4f8fd09704b10faf82c3cbde3 /pkcs11/gkm | |
parent | 87bd8e5bd86407d82850736aa7e1b9543d120d70 (diff) | |
download | gnome-keyring-d927f252d5a9181b27b3061f83d6fdf53fa64bdc.tar.gz |
Fix write_sync_close in case of partial writes.
https://bugzilla.gnome.org/show_bug.cgi?id=778269
Diffstat (limited to 'pkcs11/gkm')
-rw-r--r-- | pkcs11/gkm/gkm-transaction.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkcs11/gkm/gkm-transaction.c b/pkcs11/gkm/gkm-transaction.c index df74871c..c5f8ddd9 100644 --- a/pkcs11/gkm/gkm-transaction.c +++ b/pkcs11/gkm/gkm-transaction.c @@ -347,8 +347,12 @@ write_sync_close (int fd, const guchar *data, gsize n_data) close (fd); return FALSE; } + continue; } - n_data -= MAX (res, n_data); + g_assert (res <= n_data); + + data += res; + n_data -= res; } #ifdef HAVE_FSYNC |