- Better checking of based32 encoded Magnet Links to increase robustness

This commit is contained in:
Christophe Dumez
2009-12-13 10:15:50 +00:00
parent b541c9fa4c
commit 01c56865db

View File

@@ -283,7 +283,7 @@ public:
pos = regBase32.indexIn(magnet_uri);
if(pos > -1) {
QString found = regBase32.cap(1);
if(found.length() > 20) {
if(found.length() > 20 && (found.length()*5)%40 == 0) {
sha1_hash sha1;
sha1.assign(base32decode(regBase32.cap(1).toStdString()));
hash = misc::toQString(sha1);