From: Benedikt Bauer Date: Tue, 23 May 2017 18:25:37 +0000 (+0200) Subject: function < integer will never return false X-Git-Tag: v4.2.3~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a31d7bddb5e7372b0dba98f0654eb2199fbc8ed2;p=thirdparty%2Ftvheadend.git function < integer will never return false Sorry, if this is a strange Python thing I don't understand, but to me it looks like this has at best undefined behaviour and will at worst be completely useless because len < nlen+dlen will never be able to return false. (len is a function and needs a parameter to return any useful numeric information) --- diff --git a/lib/py/tvh/htsmsg.py b/lib/py/tvh/htsmsg.py index 853988a9a..9c925b3cc 100644 --- a/lib/py/tvh/htsmsg.py +++ b/lib/py/tvh/htsmsg.py @@ -169,7 +169,7 @@ def deserialize0(data, typ=HMF_MAP): dlen = bin2int(data[2:6]) data = data[6:] - if len < nlen + dlen: raise Exception('not enough data') + if len(data) < nlen + dlen: raise Exception('not enough data') name = data[:nlen] data = data[nlen:]