[sword-svn] r3676 - trunk/src/modules/common

scribe at crosswire.org scribe at crosswire.org
Wed Oct 30 16:10:57 MST 2019


Author: scribe
Date: 2019-10-30 16:10:56 -0700 (Wed, 30 Oct 2019)
New Revision: 3676

Modified:
   trunk/src/modules/common/swcipher.cpp
Log:
Added an additional check to be sure customization string is long enough for gear size.

Modified: trunk/src/modules/common/swcipher.cpp
===================================================================
--- trunk/src/modules/common/swcipher.cpp	2019-10-30 23:10:51 UTC (rev 3675)
+++ trunk/src/modules/common/swcipher.cpp	2019-10-30 23:10:56 UTC (rev 3676)
@@ -181,7 +181,7 @@
 	if (segs[4].size() < 5) segs[4].size(4);
 	for (int i = 0; i < 4; ++i) {
 		int csum = 0;
-		for (unsigned int j = 0; j < segs[i].size(); ++j) {
+		for (unsigned int j = 0; j < segs[i].size() && j < segs[0].size(); ++j) {
 			char hash = charHash[segs[i][j]];
 			char obfusHash = charHash[segs[0][j%segs[0].size()]];
 			if (encode) {




More information about the sword-cvs mailing list