Blame SOURCES/0033-util-fix-buffer-error-in-textfile_copy.patch

1756dc
From b2c0ab76560757296ce387f6ff2c43c983e8961d Mon Sep 17 00:00:00 2001
1756dc
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
1756dc
Date: Fri, 30 Nov 2018 11:51:38 +0100
1756dc
Subject: [PATCH 15/15] util: fix buffer error in textfile_copy()
1756dc
1756dc
Resolves:
1756dc
https://github.com/pbrezina/authselect/issues/123
1756dc
---
1756dc
 src/lib/util/textfile.c | 2 +-
1756dc
 1 file changed, 1 insertion(+), 1 deletion(-)
1756dc
1756dc
diff --git a/src/lib/util/textfile.c b/src/lib/util/textfile.c
1756dc
index 7ee5df677b519f2433d9dfa235ad72551f7ded67..3394042eaf0db9508675cbd0aedc0cc13ea6546c 100644
1756dc
--- a/src/lib/util/textfile.c
1756dc
+++ b/src/lib/util/textfile.c
1756dc
@@ -249,7 +249,7 @@ textfile_copy(const char *source,
1756dc
             /* eof not error */
1756dc
         }
1756dc
 
1756dc
-        bytes_written = fwrite(buf, sizeof(char), sizeof(buf), fdest);
1756dc
+        bytes_written = fwrite(buf, sizeof(char), bytes_read, fdest);
1756dc
         if (bytes_written != bytes_read) {
1756dc
             if (ferror(fdest) != 0) {
1756dc
                 ret = EIO;
1756dc
-- 
1756dc
2.17.2
1756dc