Browse Source

- Better checking of based32 encoded Magnet Links to increase robustness

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
e2c3e6dbaa
  1. 2
      src/misc.h

2
src/misc.h

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

Loading…
Cancel
Save