diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index c61b5c44..9256a933 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -4859,7 +4859,7 @@ _add_omemo_stream(int* fd, FILE** fh, char** err) *err = "Unable to create temporary file for encrypted transfer."; return NULL; } - FILE* tmpfh = fdopen(tmpfd, "wb"); + FILE* tmpfh = fdopen(tmpfd, "w+b"); // The temporary ciphertext file should be removed after it has // been closed.