From 7b93f043903e9a17efbed4978b2f1cece935ed00 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Mon, 3 Apr 2017 19:54:51 +0200 Subject: [PATCH] wrong use of sizeof(buf) --- src/mac/poly1305/poly1305_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mac/poly1305/poly1305_file.c b/src/mac/poly1305/poly1305_file.c index 02f2c43..e119b92 100644 --- a/src/mac/poly1305/poly1305_file.c +++ b/src/mac/poly1305/poly1305_file.c @@ -46,12 +46,12 @@ int poly1305_file(const char *fname, const unsigned char *key, unsigned long key if ((err = poly1305_init(&st, key, keylen)) != CRYPT_OK) { goto LBL_ERR; } do { - x = fread(buf, 1, sizeof(buf), in); + x = fread(buf, 1, LTC_FILE_READ_BUFSIZE, in); if ((err = poly1305_process(&st, buf, (unsigned long)x)) != CRYPT_OK) { fclose(in); goto LBL_ERR; } - } while (x == sizeof(buf)); + } while (x == LTC_FILE_READ_BUFSIZE); if (fclose(in) != 0) { err = CRYPT_ERROR; goto LBL_ERR;