From a31d7bddb5e7372b0dba98f0654eb2199fbc8ed2 Mon Sep 17 00:00:00 2001 From: Benedikt Bauer Date: Tue, 23 May 2017 20:25:37 +0200 Subject: [PATCH] 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) --- lib/py/tvh/htsmsg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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:] -- 2.47.2