[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH isomd5sum f15-branch] Allocate one more char for string sentinel. (#692135)



From: Radek Vykydal <rvykydal redhat comuser>

Adding last fragment sum to the string causes corruption
of mediasum value and check fail.
---
 libcheckisomd5.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcheckisomd5.c b/libcheckisomd5.c
index afcd198..8bca842 100644
--- a/libcheckisomd5.c
+++ b/libcheckisomd5.c
@@ -189,8 +189,8 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum, checkCallba
     unsigned int len;
     unsigned char *buf;
     long long isosize, offset, pvd_offset, apoff;
-    char fragmentsums[FRAGMENT_SUM_LENGTH];
-    char thisfragsum[FRAGMENT_SUM_LENGTH];
+    char fragmentsums[FRAGMENT_SUM_LENGTH+1];
+    char thisfragsum[FRAGMENT_SUM_LENGTH+1];
     long long fragmentcount = 0;
     MD5_CTX md5ctx, fragmd5ctx;
 
-- 
1.7.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]