From 382ccb74857c8de10d3319486a4a1137763badf7 Mon Sep 17 00:00:00 2001 From: "Brian M. Waters" Date: Tue, 3 Apr 2012 00:47:12 -0400 Subject: [PATCH] Accept invalid .torrent files. Accept .torrent files whose bencoded dictionaries are not in alphabetical order. --- misc/benc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/misc/benc.c b/misc/benc.c index 028d649..d548f01 100644 --- a/misc/benc.c +++ b/misc/benc.c @@ -233,10 +233,8 @@ benc_dget_any(const char *p, const char *key) cmp = strncmp(bstr, key, blen); if (cmp == 0 && len == blen) return p; - else if (cmp <= 0) - p = benc_next(p); else - return NULL; + p = benc_next(p); } return NULL; }