From fcad4ee1c3de869d276ca8642185cf16c54c3bcc Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 10 2020 05:44:14 +0000 Subject: Apply patch rsync-3.0.6-iconv-logging.patch patch_name: rsync-3.0.6-iconv-logging.patch present_in_specfile: true --- diff --git a/log.c b/log.c index 6143349..1215cc0 100644 --- a/log.c +++ b/log.c @@ -378,10 +378,13 @@ output_msg: filtered_fwrite(f, convbuf, outbuf.len, 0); outbuf.len = 0; } - if (!ierrno || ierrno == E2BIG) - continue; - fprintf(f, "\\#%03o", CVAL(inbuf.buf, inbuf.pos++)); - inbuf.len--; + /* Log one byte of illegal/incomplete sequence and continue with + * the next character. Check that the buffer is non-empty for the + * sake of robustness. */ + if ((ierrno == EILSEQ || ierrno == EINVAL) && inbuf.len) { + fprintf(f, "\\#%03o", CVAL(inbuf.buf, inbuf.pos++)); + inbuf.len--; + } } } else #endif